Fix a segfault in regex handling

For a regex pattern like "^/path(/.*)?$" the regex parser may
return "no match", setting the offset to UINT_MAX.

Try setting up a handler like this and then request "/path".
You might be lucky on a 32-bit system, but on a 64-bit system it is an instant segfault.