`program_invocation_name` is defined by the system headers only on
Linux, or at least it is not available on FreeBSD.
Introduce own global variable that contains the program name. If
it is unset then use `getprogname()` or `program_invocation_name`.
Co-authored-by: Ken Sedgwick <ken@bonsai.com>