avutil/threadmessage: split the pthread condition in two