Add fake return value check for write() to work around -Wunused-result

* This allows to compile with -Werror and -Wunused-result as used in Debian.