Rework locating config file for checkconfig and upgrade-master.

This changes the logic of checkconfig so that,
1. If a file is passed, that file is used.
2. If a directory is passed containing `buildbot.tac`, that file is
   loaded and `configfile` is defined there, that file is used.
3. If `buildbot.tac` doesn't exist, or doesn't define `configfile`,
   `master.cfg` from that directory is used.

The logic for upgrade-master is similar, except only directories are
supported, so (1) is skipped.
Move buildslave code around to match organization of openstack latent slave.
Report `SyntaxError` or `ImportError` from `checkconfig` and `upgrade-master`.
Merge 'locate-config': Rework locating config file for checkconfig and upgrade-master.

This changes the logic of checkconfig so that,
1. If a file is passed, that file is used.
2. If a directory is passed containing buildbot.tac, that file is
loaded and configfile is defined there, that file is used.
3. If buildbot.tac doesn't exist, or doesn't define configfile,
master.cfg from that directory is used.

The logic for upgrade-master is similar, except only directories are
supported, so (1) is skipped.
Fix python2.5 syntax errors.