fix(MockSTDIN): emit synchronous data better

Do a more thorough job of cleaning up the state object