BGE Physics Cleanup: Fix crashes with LibLoading and replication. Also fixing some memory leaks.