Do not allocate more executors than the max

- Users can specify a max_executors setting for a job, but
it is only partially respected.  If a slave is free and fewer
than max_executors are allocated, all the slave's executors will be
allocated, even if it goes over max_executors.  This makes it
impossible to test jobs in serial unless you make a cluster with
slaves that only have one executor.  And it's surprising behavior.

- Executor allocation now stops once the max is reached.
Check if local services are up before starting them

- Ran into this issue when using a local master/slave.  If
the master and slave were already up, using the build command
would wipe out the clusterrunner_slave.log, try to start the
slave service again, and log some ugly exceptions.

- Now we check if the master is up first, and abandon starting
local services if so.
Fix kwargs on os.killpg

We had mistakenly changed this call to specify its arguments with keywords
but this method does not actually accept keyword args.
Add test, fix other tests
Merge pull request #35 from box/check_if_local_services_running

Check if local services are up before starting them
Add test!
Merge pull request #34 from box/limit_executors_to_max_executors

Do not allocate more executors than the max
Merge branch 'make_teardown_better'

Conflicts:
	test/unit/project_type/test_project_type.py
Don't execute build teardown multiple times

This fixes a bug where, even after a slave disconnected from the
master, the master could send a teardown command to the slave. Since
the slave already runs build_teardown when it's shutting down, it was
possible for build_teardown to get run twice.

This change fixes the master so that it doesn't send a teardown command
when a slave has already disconnected. It also makes the slave raise an
exception if build_teardown gets executed more than once.