Buffer file writes for large files (>10MB)