Replace some usage of RUBY_PLATFORM with PlatformInfo.os_name for better JRuby compatibility