Update HomeDir function for avoid cgo.