Fix construction of union backends
We cannot just directly use xref-backend-functions, since a hook is
not just a list of functions that are to executed. Quoting from
(elisp) Running Hooks,
If the hook variable is buffer-local, the buffer-local variable
will be used instead of the global variable. However, if the
buffer-local variable contains the element ‘t’, the global hook
variable will be run as well.
Hence we need to collect all the functions that we want to add to the
union backend, in this case by using `run-hook-wrapped' and storing
the backends the hook generates.