Fixes cache not being saved on Ctrl+C exit. Refs #25.

See https://github.com/Araq/Nimrod/issues/1546.