Don't throw runtime exceptions on racy IO operations.

There's no way for application code to defend against a directory
going missing before a deleteContents call. Throw a more recoverable
IOException instead.