fixed bad perm tables holding c functions that are used as the underlying function for a c closure but are null leading to app crashing code, will throw a lua error instead; fixed the order references were distributed for c closures when unpersisting. as it was, depending on whether the underlying c function had been unpersisted before or not, it could lead to an invalid reference number (and thus a null c function)