Check if directory is empty before deleting it (closes #971)
Merge pull request #47 from thingthing/1.4-I971

Check if directory is empty before deleting it (closes #971)