Fix MAGN-4451 strange behavior with Run Automatic and Revit Document close/reopen.
Merge pull request #2408 from ke-yu/RC0.7.2_master

Cherry-pick Randy's pull request 2354.