prevent double-closing messages channel

Only close it when a read error occurs.