An arsonist who took the life of a flatmate and risked the lives of others after starting a large blaze has been jailed.