Illumos 5117 - spacemap reallocation can cause corruption

Reviewed by: Matthew Ahrens mahrens@delphix.com
Reviewed by: Sebastien Roy sebastien.roy@delphix.com

References:
  https://www.illumos.org/issues/5117
  https://github.com/illumos/illumos-gate/commit/e503a68

Ported by: Turbo Fredriksson <turbo@bayour.com>