Main thread should no longer block when saving to disk — thanks to @bachand. Fixes #377.

Addresses #299.