An Iraqi sheep farmer who set fire to two asylum seeker hotels in Essex has been jailed for almost a decade.