Bug 1076032 - Attempting to unlock closed file descriptor

* Add guard to stop attempting to unlock a closed file descriptor
Merge pull request #4952 from jwhonce/bug/1076032

Merged by openshift-bot