Attempted fixes for cache creation on linux.

Fixes for https://github.com/mcedit/mcedit/issues/492 does not fix all
errors.