UK Prime Minister David Cameron says coalition efforts have helped avert a massacre in Libya.