Renames temp directory and removes it in release builds. Refs #28.

Windows platform untested, please fix if necessary.