Fix is_locked flag on release
Add unittests
Simplify acquire/release implementation
Make redis_*_script*() static
Add REDIS_UNLOCK_STATE_* consts