marshal.c: refine special instance variables

* marshal.c (w_obj_each, obj_count_ivars): count instance
  variables accurately.

* marshal.c (encoding_name, w_encoding): separate getting encoding
  values and writing them.

* marshal.c (w_symbol, w_ivar, w_objivar, w_object): refine
  special instance variables.

git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/trunk@44838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e