Allow proper shutdown of servlet context. Refs #18506.