patches: adding assert so we don't "ignore" the fwrite return value

+ thanks @canturkisci for finding this