Commit 85ca26cc added internal buffering for peeking and unpeeking in the thread trace streams, but it failed to handle missing memrefs at the end of a trace file. We fix that here, as well as making eof checking more robust in the presence of the buffering.
Issue: #2708 (closed)