Also, what I think some forget, is that Starscream has physical needs like requiring Energon and maybe some other form of food to survive. It's not like Energon just grows everywhere and is easy to extract. It may even be in short supply on Earth now because the Cons have extracted so much of it. If he defects from the Cons, he may have no way of feeding himself anymore and may eventually starve to death and die. Energon to them may be like oxygen to us. If their bodies use up their entire store, they could die shortly afterwards. So he's not only risking Megatron hunting him down and killing him, he's also risking starvation and death if he leaves the Cons.