Illumos 5117 - spacemap reallocation can cause corruption

Reviewed by: Matthew Ahrens mahrens@delphix.com
Reviewed by: Sebastien Roy sebastien.roy@delphix.com
Original author: George Wilson

References:
  https://www.illumos.org/projects/illumos-gate//issues/5117
  https://reviews.csiden.org/r/80/

Ported by: Turbo Fredriksson <turbo@bayour.com>