Expose internal functions used by `spawn_tasks` (#3166)
This allows to build a custom version of `spawn_tasks` with less
copy-paste required.
Resolves https://github.com/paritytech/polkadot-sdk/issues/2110
---------
Co-authored-by: Bastian Köcher <[email protected]>