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.
Related to issue #1131.