Somali military court sentences 5 over terrorist attack