Borders are the "worst invention ever," Jean-Claude Juncker said, at a time when many countries are strengthening them following terrorist attacks.