Fix occasionally failing test: wait for stdin