Properly pop plugin context on exception