A safe way to create and work with a mutable permutation before returning
an immutable one for later perusal. This function avoids copying the
permutation before returning it - it uses unsafeFreeze internally, but this
wrapper is a safe interface to that function.