Bug 902460 - Close socket before NotifyError(). r=qdot, a=leo+