Adds failed connection cleanup
This code now supports 2 simultaneous AM_TARGET connections and so I'm ready to get the matlab->mex data transfer working.