Check folder exists before attempting to delete it in onBeforeDelete()

Fixes FolderTest.testSetNameChangesFilesystemOnWrite()
Merge pull request #33 from halkyon/dir_exists_fix

Check folder exists before attempting to delete it in onBeforeDelete()