JERSEY-1957: properly shut down Spring app context