A Swiss national who was accused of spying by Tehran was found dead in prison in what officials say was suicide.