Fix dfa_match_first to avoid match past nul byte