DynamoDS/Dynamo — pull request #2680 by Benglin (2014-10-12 13:32:37+00:00)
Title: Fixed failures in DynamoCoreUITests

Background
-----
A recent change causes unit test ```RecordedTestsDSEngine.Defect_MAGN_520_DS``` to throw an exception, which naturally fails the test case. What happened immediately after that was, most other tests that followed failed due to leftover components from the test preceding them.

For example, the following took place NUnit moves from ```Defect_MAGN_520``` to ```Defect_MAGN_520_DS```:

1. Recorded command in ```Defect_MAGN_520``` performs an action that marks workspace as modified.
2. Setting ```WorkspaceModel.Modified = true``` causing ```runExpressionTimer``` to start ticking.
3. ```Defect_MAGN_520``` test case ended, destroying its ```DynamoModel``` before timer ticks.
4. ```Defect_MAGN_520_DS``` starts, creating its new instance of ```DynamoModel```.
5. ```Defect_MAGN_520_DS``` starts its first recordable command, which gives a chance to the previous ```runExpressionTimer``` to tick (main UI dispatcher has a chance to pump since the playback starts).
6. The leftover ```runExpressionTimer``` ticks causing its ```WorkspaceModel.OnRunExpression``` to be called.
7. The ```runExpressionTimer``` holds on to the old ```WorkspaceModel```, which calls the old ```DynamoModel.RunExpression```.
8. Since the old ```DynamoModel``` has been shut down, its ```DynamoScheduler``` became ```null```, causing ```ArgumentNullException``` in ```AsyncTask``` constructor.

Note to reviewers
-----
Hi @lukechurch @ikeough since this fixes the build I'm going to merge it in right away. Please have a look at a later time. Thanks!