This helps prevent potential segfaults due to null-pointer
dereferencing in the face of errors when the plugin is accessed via
multiple threads.
If multiple threads are pushing errors onto the error stack then its
possible for elements of the various string pointer arrays to be left
NULL, causing a segfault when the stack is printed.
Whilst this does nothing to address the "correctness" of the plugin in
a multi-threaded context, at least it shouldn't crash.
Error messages may still be corrupted.
Error messages and function names/line numbers are traced via
__func__ or __FUNCTION__, __LINE__, etc (or just "unknown" if
not available). A manual stack is kept onto which these values
are pushed which can then be dumped to stderr/stdout.
stderr is used to report this information since no other
facility appears to be provided.