In AIX, while we followed the child process and detach on fork was on we hit thr!= NULL assertion failure.
The reason for the same was GDB core trying to switch to a child thread with tid not set that does not
exist, since child's ptid was changed to ptid_t (pid, 0, tid) in sync_threadlists() as it was threaded.
The way this happened was when a new child process is born, its object file will be loaded, calling the new_objfile ()
in aix-thread.c file from clone_program_space, which is
called from within follow_fork_inferior. Therefore it end ups syncing threadlists via pd_update ().
This patch is a fix for the same where pd_update () is called in the wait () or in update_thread_list() hook only.