Making sure that we clean up the context stack even when there are
exceptions thrown from the pipeline