More exception checking for disconnect operations

Should reduce the chance of one exception screwing up the whole disconnect process