[Service] Terminate worker more gracefully
process.exit() in node worker will call Worker::Exit(), which stop
the thread asyncronously. So WorkerThreadData is released later
after worker's exit event.
worker.terminate() in main thread will call Worker::StopThread(),
which processes Worker::JoinThread() as well as Worker::Exit().
JoinThread() can defer parent's exit() call after worker's gone.
Change-Id: Iad6bd2d64f158e7d6734500a7ab0623d75ad630f
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
(cherry picked from commit
480b6888ff5a0e9fd5983788fc4a98d97e32e217)