ecm: Move CW sending thread code in oscam-ecm.c

The moved code that implements CW processing thread is very central
to ECM procesing, so it is a good idea to move it closer to other
ECM functions.

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

First attempt to reliably stop check()/cw_process() thread on exit commited
in r8525 was reverted in r8552 because it introduced latencies.

The latencies were introduced because waking up the thread from inside
ECM processing functions was done by a signal which wasn't working once
pthread_cond_timedwait() started being used instead of nanosleep().

This commit should be the proper fix.

Thanks to wimpie007 for the testing.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8564 4b0bc96b-bc66-0410-9d44-ebda105a78c1
ecm: Simplify locking in CW processing thread.

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