Fix a use-after-free issue

In CBinaryStream, a member gets used after it has been destroyed. This was
caught by a static code analyser.