This commit adds a new signal to the autopilot agent, meant to signal
when any of the available heuristics has gotten an update.
We currently use this to trigger a new channel opening after the
external scores have been updated.
When appending to a slice, there is no guarantee the slice won't be
modified. So instead of appending to the global slice
availableHeuristics, we create a temporary local one.
This commit moves the logic querying the available heuristics out of the
autopilot agent and into the autopilot manager. This lets us query the
heuristic without the autopilot agent being active.
If called without the agent being active, the current set of channels
will be considered by the heuristics. If the agent is active also the
pending channels will be considered.
This commit fixes a subtle bug within the autopilot manager, that would
cause the active pilot to not be reset in case it wasn't started
successfully.
We also make sure the associated goroutines close over the started
pilot, and not the active pilot.