Fixed ImapStream to disconnect if Read or Write were canceled