fix a few threading issues.

1. Remove while loop in run because worker.work() is a blocking call,
the while never gets excercied.
2. Don't system exit on thread stop because that would take down Jenkins.
We want jenkins to continue running even if workers have issues.

Change-Id: I586c3eb43a18232c24b7721fd745bdaeb2bbe55a
fix bug in spawning of gearman workers

This checkin fixes a bug to spawn executor threads for the master independently
from the slaves.  Before we were skipping creating workers for master
if there are no slaves now we are spawning workers for a master as long
as the master  has executors running on it.

Also added the following verification checks..
1. valid values are entered into host and port textbox
2. a valid connection to the gearman server
3. valid actions when user clicks the save button.
   a. NOOP if launchWorker is true and there are workers already running
   b. NOOP if launchWorker is false and no workers running
   c. Spawn workers if launchWorker is true and no workers are running
   d. Stop workers  if launchWorker is false and there are workers running
   e. Always spawn management worker when launchWorker is true

Change-Id: I725a5379d9b218b6ad9c1febd6bfb3086dc910dd
Merge "fix bug in spawning of gearman workers"