fix javascript global leaks reported by mocha

as requested by https://github.com/mscdex/ssh2/issues/52