array.c: fix false assertion in ary_make_shared

* array.c (ary_shrink_capa): shrink the capacity so it fits just with
  the length.
* array.c (ary_make_shared): release never used elements from frozen
  array to be shared.  [ruby-dev:47416] [Bug #8510]

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