fix(pkg): build reasonable path always

It may fail to get the current-user home directory, and return
path like '~/xxx', which is rather bad.
Let it points to current directory when failing, and log it
for debug.

#298