Fixed a potential issue in `thread_stop`

Worker threads called `thread_stop` *after* they had already freed
`conn` data structure, while the thread stop call actually used member
of that struct.

Also, while the signature for `thread_start` and `thread_stop` had `void
* user_data`, the code was passing the address of a `void *` to them; I
don't see much point in actually changing `user_data`.

The other parameter, `conn_data` is a `void **` and it does make sense
there.