#119: speed up

The work on the #119 branch introduced some new bottlenecks into
the main daemon thread and in `cylc validate` for large suites.

This pull request contains some fixes for those bottlenecks and
a couple of minor tweaks in non-cycling-affected code that were
spotted along the way.

The main loop non-sleep CPU time is now halved compared to
the current HEAD of the iso branch for a busy suite like this one:

https://gist.github.com/benfitzpatrick/7874308

This equates to 30% better than current HEAD of master.

For a suite that hangs around like this one:
https://gist.github.com/benfitzpatrick/7875481
then the main loop CPU time is halved compared to the current
HEAD of the iso branch, but approximately the same as master.

@arjclark, please review - @hjoliver, please take a look if you
get any spare time!
The move to this function doesn't speed anything up, but it helped
profile this code block - I think we'll may need to look at this in the
future.