Better support for mg.onerror handler: call before unwinding stack