Allow UDI root directory to be set per-process.

Fix bug in packing of thread state response.
Improved robustness of handling events for multiple threads.

- included revamping the interaction of multiple threads entering
  the udirt signal handler simulataneously.