restore stdout and stderr in trap_result
restore stdout and stderr in trap_result

Change-Id: I94b5b8fb6a0268c7329a852ec11a785b9502752f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286521
Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com>
Reviewed-by: Aaron Ogata <11ccf682c06d1508642f943a3962a1c3d00b8e44@instructure.com>
QA-Review: James Butters <4c5a489c9bb72d41f20b3b22aaf4c9b864e32f20@instructure.com>
Product-Review: James Butters <4c5a489c9bb72d41f20b3b22aaf4c9b864e32f20@instructure.com>

sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms