Fix branch ordering when loading in-repo config

In-repo configs were being loaded from branches in non-deterministic
order.  Instead, load from the master branch first, then other branches
in sorted order (so that the order is deterministic).

Also, add an entry to the inheritance path for the job itself, to
improve debugging.

The master is special in that, by being loaded first, jobs that appear
there will be deemed to be the reference definition, which means they
will not have implied branch matchers added.  This is what lets us
define jobs in the master branch of zuul-jobs and have them run on
any branch of projects that use them.

The error this fixes caused random branches to contain the reference
definitions of jobs which leads to unpredictable results.

Change-Id: I425395db19cc6b336a2db9cf46415d8a5f4c036f
2 files changed