Fix up some include guards (and checks) in our header files.
btx: Add FreeBSD's r256293 (fixes boot on Jetway NF81 mobo with RAID enabled).

FreeBSD's commit msg:

Sanitize the %eflags returned by BIOS routines.  Some BIOS routines enter
protected mode and may leave protected-mode-specific flags like PSL_NT set
when they return to real mode.  This can cause a fault when BTX re-enters
protected mode after the BIOS mode returns.

Reported-by: Julian Pidancet <julian.pidancet@gmail.com>
Taken-from:  FreeBSD
bsd-family-tree: Sync with FreeBSD.
kernel - Fix spin_lock_shared() race

* Fix a serious bug in the shared spinlock code.  There are numerous races.
  The main problem is that the spin_lock_shared*() inlines set the
  SPINLOCK_SHARED bit based on a non-atomic test, assuming that the previous
  atomic operation guarded the test:

      atomic_add_int(&spin->counta, 1);
      if (spin->counta == 1)
	    atomic_set_int(&spin->counta, SPINLOCK_SHARED);

  However, this can race an exclusive spin lock in another thread inbetween
  the conditional and the atomic_set_int().  The exclusive spinlock code
  would have seen contention, but then does this:

	atomic_clear_int(&spin->counta, SPINLOCK_SHARED);
	atomic_add_int(&spin->counta, SPINLOCK_EXCLWAIT - 1);
	...

  The exclusive spinlock code then assumes that the shared spinlock code
  can no longer set SPINLOCK_SHARED.  However, if this occurs just after
  the shared spinlock code's if (spin->counta == 1) but before it atomically
  sets the SHARED bit, we wind up in a situation where the exclusive spinlock
  code completes its operation and leaves the SHARED bit set.

  In other words, the code which believes it has sucessfully obtained an
  exclusive spinlock actually winds up getting a shared spinlock.  Oops!

* Fixed by guarding the shared lock conditional and atomic op and changing
  the way shared lock contention is handled.

* Case was only reproducable on monster, probably due to massive shared
  spinlock use in the pmap code on 48 cpu cores all fork/exec'ing /bin/sh
  at the same time.
kernel - improve pv_hold()

* pv_hold() can just use an atomic_add_int() here.