Checking if a type is a reference must be gsharing aware.
* mini-generic-sharing.c: Add mini_type_is_reference
that returns true for VAR and MVAR if compiling under
gsharing.
* method-to-ir.c: Replace usage of mono_type_is_reference
with mini_type_is_reference.
* mini-gc.c: Ditto.
* mini.c: Ditto.
With the old behavior, the JIT could interpret a (M)VAR
variable and not been a reference type. This is an issue
for sgen as we could forgot to emit some write barriers
or generate the proper stack map.