Make sure printf("%s") is not getting any NULLs.

ERR_reason_error_string() may return NULL if there is no error, so make
sure we do not crash (such crash occured on Solaris 10).
Sanitisation.
A bit of beautification.
Make sure parent kills the child if it exits prematurely.
Convert malloc()+sprintf() to xasprintf().
Undead-ify child.