Keyword parsing: protect against Perl realloc-ing the buffer