MKtl: only close device if there is one to close