Sync buffer contents to file on disk.
Gets the current buffer contents and writes them to the file. Used when buffer contents have been modified via GTK operations (user typing, etc.) and need to be saved to disk.
2. Write to file (creates backup, writes, updates metadata)
3. Mark buffer as not modified
4. Update last_read_timestamp to match file modification time
This method is only supported for GTK buffers. For dummy buffers, use write() instead.