The agreement could see Turkish troops deployed to defend Tripoli from renegade military commander Khalifa Haftar.