fix dead imapStream resource handling