Fix race conditions between isRunning() and getResult(). Result must be
non null to declare a plan not running anymore