Attempt to claim the desired Lock type using a byte range of a file.
If the desired Lock type cannot be obtained without blocking, an
Error of kind ErrorKind::WouldBlock is returned. Otherwise if
successful, the lock is held.
The byte range does not need to exist in the underlying file.