Modify with_lock to take an already created instance of acquire.

In doing this, it also required that we change the signatures of
BasicLock.__init__ and BasicLock.acquire to move max_retry and retry_wait to be
instance attributes.