Need to check dir exists before removing

Subdirs could end up being removed in a race condition via rmdir at end
of deletePlugin function
Tweak die error messages to indicate dir or file