fix serializer for large linearizations

Writing the array length as a byte breaks when the linearization of a class
exceeds 127. Since byte is signed, the length will be seen by the
deserializer as a negative number and will trigger the error path. Storage
is cheap, let's use an int instead for the length.

Also fixes up two other locations in the serializer (ScFunctionElementType
and ScModifiersElementType) where byte was used to serialize array
length.

Fixes http://youtrack.jetbrains.com/issue/SCL-5026