os: Properly report failure to link lock file
Stop assuming that a failure to link always means that the file indeed exists. In case of other failure (e.g., permissions), the user would get an inconsistent "Can't read lock file" message.
First proposal for issue #1139.