fix bug sending incorrect child ID in pthread join