Handle races where a regular file inode is replaced by a directory.

Addresses #19.