Libyan forces say they have regained full control of vital oil terminals in the east after a militia attacked the facilities two weeks ago.