(#20302) File.expand_file('~') fails differently in Ruby19

In ruby 1.8, calling File.expand_path('~') when HOME is undefined
would raise ArgumentError on both Unix and Windows.

The same test in ruby 1.9 does not raise on Windows, because ruby
also looks at HOMEDRIVE and USERPROFILE. Only if all three are
undefined does ruby raise ArgumentError as expected.

This commit ensures all 3 environment variables are undefined in util_spec. It
also only tests the platform specific RunMode functionality on the appropriate
platforms, and adds tests that were missing on the Windows side.