rebase: rework extrafn handling to support multiple extrafns
This makes it possible to pass keepbranches and extrafn to rebase at
the same time, although nobody uses that functionality presently. This
is a precursor to keeping graft metadata.
Testing that hghave does not crash when checking features $ "$TESTDIR/hghave" --test-features 2>/dev/null