Fix up command-line's ThumbnailCache.

ImageMagick was messing up when we were passing it file names like "Screenshot - 02152013 - 11:49:03 PM.png[0]".
Close fd after ImageMagick exits.