core/byteio: add read_tag/peek_tag for reading four-byte tags