Fix getter methods for optional fields

Optional fields are supported. However, in generated code their getter methods will not return `null` in case when those fields are not specified.

To fix this, return type of getter is set to be `$fieldType` (which, unlike $propType, does contain `?` at the end for optional fields), and original value (specified or not) is returned as is.