Doha, Ankara agreement pledges joint action against external attacks as fighting in Yemen displaces civilians.