Fix two bugs in ToggleReadStatusOperation

- Used to return opposite unread value
- Exceptions in some environments because of incorrectly closed streams