Lock.release(): reorder code to avoid token overwrite
* assignment to self.token was not protected by the lock, so the value could get overwritten
* do_release() now has an expected_token parameter that receives the old token value
* NOTE: this only fixes the issue for locks that do not have timeouts
Merge pull request #489 from dystedium/fixlock2

Lock.release(): reorder code to avoid token overwrite