JERSEY-2471 Fix some javac type cast warnings

cf. https://java.net/jira/browse/JERSEY-2471

No semantics changed, all unit tests are still passing.