Properly check all arguments and behave in a sane manner, i.e. don't crash.
I went back and forth a few times on whether to return `NULL` or `dest` when `n == 0`.
* On the one hand, `n == 0` is not really an error and a situation that could
naturally occur, e.g. when you're implementing code that appends to the end
of a string.
* On the other hand, if we return `NULL` when `n` is zero we can guarantee
that we will either return `NULL` or a null terminated string.
Ultimately I decided to go with the stronger guarantee, i.e.