Lock or unlock files with fcntl()

fcntl() finally accepts flock struct that describes the lock as its
third argument.