perl: Expose nbdkit_set_error to perl script
In addition to calling Perl functions from C, we want to make
script writing easier by exposing C functions to perl. For
now, just wrap nbdkit_set_error(), as that will be needed for
an optimal implementation of a zero() callback.
I intentionally decided to go with a hand-rolled XSUB statically
compiled in, rather than a full-blown dynamically loadable Nbdkit
module compatible with CPAN, in part because the machinery to hook
in a call to xsubcc would be lots of code, and in part because we
already document that the user's script is not executable as a
stand-alone perl script anyways.
Perl is very picky: I found that including <XSUB.h> after <EXTERN.h>,
even with no other changes in the file, caused the embedded
interpreter to segfault during perl_open(); but listing <XSUB.h>
first worked for me (tested on Fedora 25).
Signed-off-by: Eric Blake <eblake@redhat.com>