Synchronize device cache on close only if there were some write operations.
While these operations are not really needed otherwise, at least for SCSI
they may cause extra errors if some other initiator holds write exclusive
reservation on the LUN (SYNCHRONIZE CACHE handled as "write" operation).

Conflicts:
	sys/cam/ata/ata_da.c

(cherry picked from commit 6761e997d0a0fa65f172398e3801639bb4de5ce1)