Fix two problems in gdt, introduced in 4.7. Eliminate a use-after-free of xs for xs->flags. Avoid calling scsi_done() twice when sync'ing disks during shut down.
Fix two problems in gdt, introduced in 4.7. Eliminate a use-after-free
of xs for xs->flags. Avoid calling scsi_done() twice when sync'ing
disks during shut down.

scsi_done() problem found by Federico Giannici. Feedback and fixes
from matthew@ and dlg@. Testing of various versions by Federico and
sthen@ via Pierre Berthier.

ok matthew@ deraadt@

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars