Fix last count value after ReadAll() and WriteAll().

This corrects the bugs introduced when applying the patch adding these
functions in r74034: we can't simply use m_lastcount directly in them because
it's also modified by each call to Read() and Write(), so do use the temporary
variable.

See #12056.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775