Add repr(C) to flock structs
Fix handling lock conflicts
Check that lock still references current pidfile