Add missing flags field in thr_param struct.
Do proper locking on tb for threads.
Merge branch 'master' of https://github.com/staceyson/qemu-devel-1.4.0

Conflicts:
	work/qemu-1.4.0/bsd-user/syscall_defs.h