Somalia's internationally-backed president is safe and was not inside the presidential palace when Islamist Shebab militants launched an attack on the presidential palace complex, security sources said.