app: revert xcf_write_int8() to work like in 2.8.10, and fix its return value

This reverts one line of commit 0657a68d2ef18f9f8c67e9fad938406b1ff6f38f
which is supposed to only add docs. Also, actually return the number of
byzes written, not always the number of bytes we intended to write.