Refactored JobPrefixFile class.

The new version properly handles closing of FileChannels, and
users of the class no longer need to deal with FileLocks directly.