A failed coup in Turkey could create new headaches for Europe as it struggles to stem the flow of migrants.