Ensure directory exists before creating index.

This is smallest-possible fix to address the bug head on.
A more thorough fix, including an overhaul of EphemeralFileSystem is on its way via the master branch.