Assert that lock is held at unlock.

Closes #26.