ci: Run sanity job only in pre-merge pipelines
It's more of a nuisance than useful for forked branches.
This means the test-docs job can no longer have a direct dependency on sanity for forked branches, so split it up into two jobs: one for pre-merge pipelines, one for forked branches.
/cc @anholt