Add disconnect support to netlib