added thread.h include (necessary since 227c847135c5d85cf0e9fe5770f5c47a0e5cba3b).

Elimnates some warnings.