Making ORB_HashFunctionForTransformations/PartialPerms compatible with earlier versions of GAP

I reintroduced the previous code for the two functions mentioned, so
that Orb will still work with older versions of GAP.