Fix for SPARK-2228

Add check to see if stageId exists in stageIdToPool before attempting to remove it from poolToActiveStages.