Use unused value in perlglue.xs, caught by clang scan-build

We now die on a failed zephyr_zwrite.
Fix some undefined behavior in filter.c, caught by clang scan-build