merge revision(s) 46550,46557,46565,46570,46585,46595,46822: [Backport #9977] [Backport #9978] [Backport #9983]

	* hash.c (ruby_setenv): fix memory leak on Windows, free
	  environment strings block after check for the size.
	  [ruby-dev:48323] [Bug #9977]

	* hash.c (env_select): fix memory leak and crash on Windows, make
	  keys array first instead of iterating on envrion directly.
	  [ruby-dev:48325] [Bug #9978]
	  keys array first instead of iterating on environ directly.

	* hash.c (env_shift): fix memory leak on Windows, free environment
	  strings block always.  [ruby-dev:48332] [Bug #9983]


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