Fix stdin handling in engine.Sender and engine.Receiver