Ensure that newly staged files are not unrecoverably lost.

This doesn't manage to preserve the staged status of a file so it's not
great, but at least we're not losing actual file data now.

fix for Issue #4