LOGSTASH-1066 - refactor Windows jar path wrangling into its own method

I ran into LOGSTASH-1066 when trying to use the elasticsearch_http output on Windows - looks like the fix is to use the regexp on the path in both the "dir" branch and "jar" branch of expand_path in JRUBY-6970.rb, so I refactored the regexp code into its own protected method and called it from both places.

I did test runs on both Windows and Ubuntu with my logstash config and my change appears to work in both environments.