Is it guaranteed that realpath always makes a copy, even if the input and output are identical? Otherwise we could end up freeing a GC-managed buffer here.