Generated Java code should read/write enums correctly

When reading/writing enums over the wire, they are defined
as TType.I32, and not TType.ENUM, as one would expect.
That quirk was already fixed in the generated Scala code.

- Port enum fix from Scala code generator to Java code generator