Remove unused `fcntl` checks.
Simplify logic
Do the additional SunOS checks when trying to lock the file handle.