When engine emits 'close', flush the connection to remove timeouts then hold the process open.
Port Adapter#close functionality to Ruby.