Crashfixes

Fixes crashes on chunk unload while active; the world tick arrives
before the chunk unload message, but the TEs are inaccessible, so we
have to check to see if the TEs are valid.