pat: fix a bug that chop() may return true for no suffix case

`**key` may not be NUL-terminated. So we should use `end` to detect the
end of string.