Fixed flock for linux.
Vastly simplified locks, should work for us.