avoid deadlocks which empty cache files, closes #1632

this should not happen, but just in case...