merge revision(s) r46550: [Backport #9977]

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


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46557,r46565: [Backport #9978]

	* 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.


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