sed: Fix a UBSan warning and clean up a pedantic few compiler warnings
This avoids adding a zero offset to a NULL pointer, but written in such
a way that the compiler can generate the same code as before. While
touching this file also clean up a few signed/unsigned warnings.
usr.bin/sed: Speed up vector grow
Double the size when we run out of space instead of using 1K at a time.
I noticed this while debugging an infinite loop due to
https://github.com/google/sanitizers/issues/1371
usr.bin/sed: Add an assertion that REG_STARTEND
This was helpful while tracking down an ASan interceptor bug
(https://github.com/google/sanitizers/issues/1371).