The trade balance between the European Union and the rest of the world has returned to surplus after six consecutive quarters of deficit.