Public barred as Tanzanian president sworn in