Lock: implement an exponential backoff on the retries with a max sleep period

This fixes issue #24.

Retry timeout starts at 5 milliseconds and doubles on each failed retry until it reaches a maximum of 1 second.