Add table-driven unit tests for unlock() that exercise success and error paths, cover flag and arg handling.