Expand ~ in Path::resolve