Work decoupled from #28574.
Instead of performing multiple single write operations per spkm setup call, this PR batches them all within a single atomic db txn.
Speeding up the process and preventing the wallet from entering an inconsistent state if any of the intermediate transactions fail (which shouldn’t happen but.. if it does, it is better to not store any spkm rather than storing them partially).
To compare the changes, added benchmark in the first commit.