HPCC-11637 Avoid multiple concourrent ECLWatch onActivity queries

Add a critical section block to allow only one thread to build
onActivity response; move the code of setting Activity response
into one function which is called after all of the response
information are collected; store the information (and information
collect time) into one WsSMC data member; reuse the information
if another Activity request comes through shortly after a recent
request.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
This function can't really have any references to version - or the request.
If it does then a request for a different version that matches the cache will return the wrong results.

You really have 3 options

a. Make this function completely independent of response.  Have all version specific and response specific processing in the function that returns the result.  This is the simplest approach.

b. Allow this function to be dependent on particular variables (e.g. username).  It is much safer and clearer if those dependencies are explicitly passed in rather than extracted within the function.  You can then

   1. Check the parameters match the cached items and recreate if they don't.  (This is likely to be rebuilt a lot and may not cache much.)
   2. Have a hash table or something similar which saves a cached value for each combination of parameters.  (This needs to have a limited size and make sure items are expired in a timely fashion.)