fix occasional stdin non-termination, #100