Try to work around process stream closing bug in JDK