connectInput() and connectOutput() need to be atomic if set in  a
queue. This fix a bug that may happen when spamming undo/redo while
during playback.