Libyan coastguard fired warning shots near a Mission Lifeline humanitarian ship and boarded it in a search for migrants, according to a spokesman for the charity.