3252 Need a proper flock() implementation