Fixed another crash on unload

Crash report: http://crash.pocketmine.net/view/22711
It is a bad practice to write code like this, but it is already bad in the first case, so let's let that go :D