py, gc: Fix old gc_realloc for case when NULL is passed in as ptr.