lexer: fix length of buf in `scan_identifier`