Initialize thread state struct.

This bug has been found while investigating https://github.com/lano1106/glcs/issues/12

A thread was aborting on line thread.c:326 which is

        /* thread finish callback */
        if (thread->thread_finish_callback)
                thread->thread_finish_callback(state.ptr, state.threadptr, ret);

A typical example of such CB is

void pack_thread_finish_callback(void *ptr, void *threadptr, int err)
{
        free(threadptr);
}

because threadptr was not initialized to NULL, you could end up passing a bogus pointer
value to free().

This is really mysterious as why I have never experienced the problem myself.

Signed-off-by: Olivier Langlois <olivier@trillion01.com>