This routine is called by the I/O completion routine if it detects an error. It either frees or arranges to free any resources that might have been allocated for processing a query from the master agent. The information at pPkt and pHdr is passed unchanged into the completion routine.