Nine people including at least five foreigners have been killed in an assault on a luxury hotel in the Libyan capital Tripoli, a spokesman for the security services said.