Detect unsupported PREVENT ALLOW MEDIUM REMOVAL and SYNCHRONIZE CACHE(10)
to not spam devices with useless commands and logs with errors.

(cherry picked from commit 3be5fcbcfd0d79067617f4be3e084cf64188a218)
Oops, revert unwanted part of r253721.

(cherry picked from commit 1e4488ade806c781c177abec051ee54bfc5143a6)
Improve r253721 by reporting detected lack of BIO_FLUSH support to GEOM.
That prevents more of such requests from coming and errors from logging.

(cherry picked from commit 329753c36e1e9d64afce0bc82c9a4f02a64b7934)
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)