Fix ~33MB leaked RAM on core unload.