YARN-2547. Cross Origin Filter throws UnsupportedOperationException upon destroy (Mit Desai via jeagles)

(cherry picked from commit 54e5794806bd856da0277510efe63656eed23146)