fix(pkg): Fail gracefully when unable to detect homedir

ParseFilepath may fail to get the current-user home directory, and return
path like '~/xxx'. Point to current directory when failing, and log it.