JRuby fixes

I'm not wild about conditionally loading things in the gemspec, but for development dependencies this shouldn't be a problem.  I do expect the libvirt tests to fail as a result, but I don't have that configured locally, so I'll need to see the failures in Travis to adjust.  And the unicode hack is just to get things loading for now -- a proper fix for #2279 will be forthcoming once this and PR #2312 have landed.