At least four people died in a bomb attack in the Somali city of Baidoa, and a car bomb in the capital, Mogadishu, wounded several police officers.