lock.py: Allow timeout to be 0
A timeout of zero means that LockFailedError
will be immediately
raised if the lock is not available.
Also, in _get_deadline_check_interval
, poll more often than 30
seconds if the timeout is small.
Related MRs:
- !517 (merged)
- !516 (merged) (This MR)
- !515 (merged)
- master