Support long in state again (#13692)

The fix to #9379 broke the support for long type fields in state classes. This
patch bypasses the unboxing of long values and adds the @UnsafeNativeLong annotation
to the methods which may fetch and return (without modifying) long values.

SerializerTest is extended to test the different data types in States.

Change-Id: I29fd2c6af13cd9a0d29ecb1444ed9eb8a2b013e3