Use thread identifier for worker thread.
Fixed problem with stop and added some logs.
Fixed to handle a case when connector throws an exception.