Fixed a bug where two threads cleaning up the cache directory could attempt to
delete the same file - causing one of the threads to raise an unhandled
exception.

Fixed a bug where an exception received while writing a modified file to
vospace would cause a thread to be lost in the write thread pool.