MFC r248868, r248874:
Implement CAM_PERIPH_FOREACH() macro, safely iterating over the list of
driver's periphs, acquiring and releaseing periph references while doing it.

Use it to iterate over the lists of ada and da periphs when flushing caches
and putting devices to sleep on shutdown and suspend.  Previous code could
panic in theory if some device disappear in the middle of the process.
MFC r248872, r249048:
Make pre-shutdown flush and spindown routines to not use xpt_polled_action(),
but execute the commands in regular way.  There is no any reason to cook CPU
while the system is still fully operational.  After this change polling in
CAM is used only for kernel dumping.
MFC r249091:
Use xpt_lock_buses() instead of equivalent mtx_lock(&xsoftc.xpt_topo_lock)
to unify the code.
MFC r249104:
Move CAM_DEBUG_CDB messages from the point of queuing to the point of
sending to SIM.  That allows to inspect real requests execution order,
respecting priorities, freezing, etc.
MFC r249105:
Remove extra NULL checks. d_drv1 can never be NULL during periph life cycle.
MFC r249106:
Replace some direct mutex operations with wrappers.