HPCC-11445 Roxie not stopping unused sink activities

Reinstate code that was removed in 3.8 when tidying up code that was believed
to be unused.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>

Conflicts:

	roxie/ccd/ccdserver.cpp
HPCC-11445 Roxie not stopping unused sink activities

Fix errors stopping a csvwrite that was not started.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
HPCC-11477 Activities are being reset excessively

Better fix for the issue that was partially fixed in 4.2.6

Also fix the case where a sink activity was still in reset state even though
there were upstream activities started.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
HPCC-11477 Activities are being reset excessively

Worked out why it is not safe to ignore stops for activities that are in reset
state (they are needed by splitters).

Regression suite and RW query now both execute with no state errors.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
HPCC-11458 Uses a new control ID for WHEN,BEFORE (fix stopSink error)

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>

Conflicts:

	thorlcr/graph/thgraph.cpp
HPCC-11458 Fix clashing id

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #5927 from richardkchapman/reset-sinks-46

HPCC-11445 Roxie not stopping unused sink activities

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>