PUB-API: fix write_file() declaration
FILE: improve error handling
POLY: improve error handling
BUILD: rm obsolete references
POLY: name labels consistently
POLY: fix infinite loop for non-invertible polynomials
KEYGEN: improve error handling, be less fault tolerant
PUB-API: fix syntax errors
KEYGEN: improve error handling

Check for NULL-pointer arguments and add bool return value
which indicates whether any of the file operations failed.
ENC: fix possible memory error

LZ4_compress might add a null-byte, so we have to account for that.
POLY: fix segfault for non-invertible polynomials
FILE: improve error handling

This also fixes various valgrind warnings. We explicitly
check if we operate on a regular file instead of relying
on error handling of fopen/open.
TESTS: initial test suite implementation