Explosions have shaken the Libyan capital, as Nato prepares to deploy Apache helicopters over the country.