replace some gpl'd code with a non-viral alternative. *sigh*

no functional change intended, but only compile-tested so far
specify radix explicitly
fix typo from sscanf->strtoul conversion
fix strtoul ep test. also, assign result
Preserve domain on crash.

The tests can run so fast that the console server doesn't have
a chance to catch up.