Make rmdir recursive for local storage

Backport of 63c898c0