The European Parliament has voted on new return policies, allowing for longer detention of migrants and establishing return hubs outside the EU.