pdump: fix error check when creating/canceling thread