Fix credential checking for JRuby + Windows

JRuby on windows reports its RUBY_PLATFORM as java so RubyGems assumes
it supports File.chmod even though it doesn't.

Now we use RbConfig::Config['host_os'] to detect the platform which
works on JRuby + Windows.

See also #438

Fixes #477