Try preventing the race condition in PtyRecorder test