cylc: single db access object

This should fix the problem reported by @hjoliver for database and suite stalling when Phil's huge suite is run.

Makes the following changes:
 * should only be one instance of the `rundb.py` db object.
 * task proxies now take in `exists` and `submit_num` arguments rather than querying for these themselves
 * `cylc-restart` uses the main db object to query for task details rather than ones attached to task proxies
 *  `rundb.py` changed to add convenience methods for the above
 * minor fix for task state updating in `task.py` as `submitted` was overriding `succeeded` in cases of out of order messages