Fix JRUBY-7096 JAVA_HOME value corrupted

The c_str reference to the JAVA_HOME value was referring to an out-of-scope std::string object causing it to be corrupted. Convert it to a std::string to preserve the value.

With this fix, jruby starts correctly and no longer see this error message: 

Cannot locate Java installation, specified by JAVA_HOME:
└ðÓ­á├Q%am