JERSEY-2429: JDK8 support

I merged a subset of https://github.com/jersey/jersey/commit/411f767d3686ee494000741ee60f24419264679c into Jersey 1.x.

This fix works for me. Please review, test, and merge.