core: don't delete data dir if no data dir [GH-4017]