RootUtils: Add WithRootErrorHandler.
In a couple places, we want to run a piece of code with an overridden root error handler. Since the root error handler is simply a global pointer, this is not MT safe. Introduce WithRootErrorHandler to try to allow doing this in a thread-safe manner.
See ATEAM-715.