Somali military court sentences 2 foreigners over terror links