Revert "Replace a couple of contextmanager functions with ExceptionStackContext."

This reverts commit 440e5355cfd0e3b1da5e5782568270d2ccd13dac.