dfa: avoid undefined behavior of "1 << 31"

* src/dfa.c (charclass): Change type from "int" to "unsigned int".
(tstbit): Rather than shifting "1" left to form a mask, shift the
LHS bits the right and use "1" as the mask.  Also, return bool, rather
than "int".
(setbit, clrbit, dfastate): Don't shift "1" (aka (int)1) left by 31 bits.
Instead, use "1U" as the operand, to avoid undefined behavior.
Spotted by gcc's new -fsanitize=undefined.
Co-authored-by: Paul Eggert <eggert@cs.ucla.edu>
maint: minor cleanup: xmalloc+strcpy -> xmemdup

* src/main.c (main): Replace an xmalloc+strcpy combination
with an equivalent use of xmemdup.
tests: port to non-GNU sed

* tests/multibyte-white-space (utf8_space_characters): The generation
of test inputs relied on GNU sed's interpretation of \<, but that is
not portable, and caused spurious test failures.  Adjust the sed regexp
to work on all versions.
Reported by Karl Dubost in http://bugs.gnu.org/15953.