For example, if we detect a connection with index K, we can change its index to -1. If the connection is never used, all is fine, and if it's used it'll trigger a run-time error.
The background is that R does not protect against using connections in other R sessions. This should ideally be fixed in R itself, cf. HenrikBengtsson/Wishlist-for-R#81