A Kuwaiti court has convicted a citizen of of spying for Iran and sentenced him to life in prison.