modules/filesystemprovider: Check directory access before doing anything.