check if a directory exists before we try to remove it
Merge pull request #6158 from owncloud/rmdir-check

check if a directory exists before we try to remove it