On Mac, copy password data, free the native memory, and return the copy.