Fix OPENAPPEND to honor the BOM of the file to which its appending.
Because fopen in "a" mode doesn't allows seeking, it was not possible to read the BOM file the FILE that was opened. Instead, the different FILE is opened for reading, just to get the BOM.