Saner Market shutdown.

* Automated mutex acquisition and release.
* Renamed variables to document signal handling API.