At least three members of the Somali security forces were killed as they tried to defuse a bomb inside a vehicle in the capital Mogadishu, police said.