Only set the previous error handler if there was one.