mir: release a connection on error