core: remove homedir only if it exists