Core: improve handling of deinitialisation and game unloading.