Make local vars static

Signed-off-by: Dima Kuznetsov <dkuznets@redhat.com>
Add graceful termination

Added argument passing between the threads, enabling them to signal each
other (in a given order) that no more work should be done and they
should return.

Each thread can stop the requestReader, who in turn messages
requestHandler. requestHandler flushes all worker threads (to give them
chance to write to responseWriter's queue) and messages the
responseWriter to terminate.

Signed-off-by: Dima Kuznetsov <dkuznets@redhat.com>