MFV r272804:

Refactor the code and stop restore_object from creating two transactions.

Illumos issue:
    3693 restore_object uses at least two transactions to restore an object

MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272810 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f