I agree with an earlier post: getting caught in a headlock may be the result of shooting from too far. Or, paradoxically, from trying to shoot while too close and giving up your head because your level change was sloppy.
Trying to keep my head tight against my opponent's outside leg seems to help me. That and sucking the leg in and up as quickly as posssible. If your initial step disrupts your opponent's balance, you're half way home and he has little chance for a headlock. That first step should be deep and powerful, I think.
BTW, college wrestlers now drill a sort of double shoot. Hard to describe, but they assume their opp. will sprawl and block the first attempt, so they shoot, flop and shoot again in one quick sequence.Impressive to watch.