Reliably stop reader_check() thread on exit.

Use timed condition instead of cs_msleep() and check for oscam_exit variable.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8524 4b0bc96b-bc66-0410-9d44-ebda105a78c1
Reliably stop check() thread on exit.

Use timed condition instead of nanosleep() and check for oscam_exit variable.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8525 4b0bc96b-bc66-0410-9d44-ebda105a78c1
Prevent leaking of internal work_thread data.

If some callback called by work_thread executes cs_disconnect_client(),
cs_exit() or pthread_exit(NULL) then the work_thread will be terminated
but allocated network buffer (mbuf) and the current struct job_data will
be leaked.

This patch adds tracking of mbuf and current job_data to struct s_client
and when the client is freed the work_thread related data is freed as well.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8526 4b0bc96b-bc66-0410-9d44-ebda105a78c1