Fixes <https://issues.guix.gnu.org/55721>.
Starting from the switch to functional object caches ca.
9e5812ac59b01ff011ec0c5b0f437dfe85d6fcc7, we would be losing accumulated
caches when aborting to the build handler. This patch fixes that.
In particular, by preserving '%reference-cache-id', we avoid redundant
'query-references' RPCs, which accounted for a large part of the extra
processing time.
* guix/store.scm (build-accumulator): When returning an <unresolved>
node, call 'set-store-connection-caches!' before and after to preserve
caches.
(map/accumulate-builds): Pass STORE as the first argument to
the <unresolved> continuation.