Reduce the scope of various variables

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>
Use fprintf(3) to display error messages to stderr

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>
Cleanup debug message handling

Create a wrapper around printf for the display of info/debug messages.
These messages will only be displayed if the SODIUM_DEBUG environment
variable is set to anything other than 0. It displays the message
prefixed with the name of function that it originated from.

If debuging is disabled we also make stderr point to /dev/null to avoid
message spew from clutter and anything we fork/exec.

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>