[Ruby] Manage scripting container in tests

As apparently, at least on my Mac, this change prevents
the EBADF related errors to occur.

Related:
http://stackoverflow.com/questions/6888281/jruby-embedding-prob-puts-appears-to-fails-with-raiseexception-errnoebadf

CI
http://bamboo.s/browse/NX-OSSF316