fixed race condition with closing std-in within jvm