Handle panic from deferred functions

Rejiggered things a bit:
 - Now we have a TLS stack of deferred functions.
   This is used to determine validity of recover().
 - When panic() is called, it immediately pushes an
   error to tlserror, and then throws an empty exception.
 - When recover() is called, it clears the entire
   tlserror stack.
 - Each deferred function call is now guarded against
   exceptions.