Kernel: Added freeing of kernel objects on emulator shutdown.