Issue title: Samtals sort -t CB deletes CB tags from the sorted bam 
 Issue body: I posted the same question  in Biostars a couple of weeks ago but have not gotten any response.   Anyhow,   I am using Ubuntu (focal) AWS EC2 and try to sort  10k Peripheral blood mononuclear cells (PBMCs) single index file from 10x.   I used samtools to sort a 10PBMC bam file from 10x by firing a following command;

`samtools sort -l 7 -m 2048M -t CB -O BAM -@100 -o /temp/home/cellsorted_PBMC.bam /temp/home/PBMC_10K.bam`

I noticed that CB tags in the original bam file were missing;

`A00519:643:HCMYWDSXY:4:2172:22525:26287 16  chr1    148893  255 91M *   0   0   ACATGGCAAGATCCCGTCTCTATGATAAAAAATTAGCTGGACATGGTGGCACATGTCTGTAGTCCCAGCTACTTGGGAGACTGAAGTGAGA FFFFFFFFFF:FFF:FFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NH:i:6  HI:i:2  AS:i:89 nM:i:0  RG:Z:SC3_v3_NextGem_SI_PBMC_10K:0:1:HCMYWDSXY:4 TX:Z:ENST00000484859,+724,91M   GX:Z:ENSG00000241860    GN:Z:AL627309.5 fx:Z:ENSG00000241860    RE:A:E  MM:i:1  xf:i:17 CR:Z:GCAGCTCTGTGAATAT   CY:Z:FFFFFFFFFFFFFFFF   UR:Z:TCTAAAACCTAC   UY:Z:FFFFFF:FFFFF   UB:Z:TCTAAAACCTAC`

The original unsorted bam has CB tag,

`A00519:643:HCMYWDSXY:3:2144:3649:12790  16  chr1    498309  1   65M26S  *   0   0   GGCCAAAATATGTAAGCACATTTGCATTTATTAGGCACTTTATTTCCATTATTACACTGTGATATCCCATGTACTCTGCGTTGATACCACT F,,,FF:F,FFFFF:FFFF:FFFFFFFFFFFFF:FFF,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:F:FFFF:FFF:FFFFFFFFFFF NH:i:4  HI:i:1  AS:i:61 nM:i:1  ts:i:26 RG:Z:SC3_v3_NextGem_SI_PBMC_10K:0:1:HCMYWDSXY:3 RE:A:I  xf:i:0  CR:Z:TCATTGTAGTATAGAC   CY:Z:FFFFFFFFFFFFFFFF   CB:Z:TCATTGTAGTATAGAC-1 UR:Z:ACTCTAATCTGC   UY:Z:FFFFF:FFFFFF   UB:Z:ACTCTAATCTGC`

I samtools sorted a smaller, truncated version of PBMC_10K.bam (created by` samtools view -h Parent_NGSC3_DI_PBMC_possorted_genome_bam.bam|head -n 10000 | samtools view -bS > test.bam`) by the exact same samtools command, I saw the CB tag preserved in the sorted bam.   I must be missing something and I'd appreciate any pointers.   Thanks. 

`samtools --version samtools 1.11 Using htslib 1.11 Copyright (C) 2020 Genome Research Ltd`

```
lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.1 LTS
Release:	20.04
Codename:	focal
```

 Comments: 
 Comment 0: Do all of your input reads have `CB` tags, and are you only looking at the head of the sorted file?  When using the `-t` option, reads without a tag will be sorted before reads that do have one (see the "Ordering Rules" section of the [manual page](https://www.htslib.org/doc/samtools-sort.html)).
 Comment 1: I saw your response to the old post #1069.  Anyway,  I run `samtools view -h cellsorted_PBMC.bam |grep CB:Z`,   and waited around a few minutes and saw the first read with CB tag, the first being;

`A00519:643:HCMYWDSXY:3:1574:11984:32831	4	*	0	0	*	*	0	0	AGTGAAAAAAATTTAAAAAAAAAGTTAAAATAAACTTCATAAACATTTGATAAATTAAGCCAAGGAATTGGTTAATAAGCAAAAAATTTCT	,,F,:38d1:d2b4:3d06:83e8:96a5:8c2:893d:aba5F:,FFF,,F:FF:F,,FFF:F:F,FFF,F,:F:,,,,FF,,F:,F:,F:F,,38d1:d2b4:3d06:83e8:96a5:8c2:893d:aba5,,:,FF:FF,:,,F,,38d1:d2b4:3d06:83e8:96a5:8c2:893d:aba5,:,FFFF,,	NH:i:0	HI:i:0	AS:i:23	nM:i:4	uT:A:1	RG:Z:SC3_v3_NextGem_SI_PBMC_10K:0:1:HCMYWDSXY:3	xf:i:0	CR:Z:AAACCCAAAAAACACT	CY:Z:FF,F:,,F:F,F:FFF	CB:Z:AAACCCAAGAAACACT-1	UR:Z:ATCAGGAAAAAT	UY:Z:,F:,FF:F:F,F	UB:Z:ATCAGGAAAAAT`

Is there a way to find out number of reads without the CB tag ?  

Thanks. 
 Comment 2: There's nothing built in to samtools that can do that count, but (after sorting) you could use grep -n to find the line numbers matching CB:Z and bail out after the first one.  Eg:

```
samtools view cellsorted_PBMC.bam |grep -n CB:Z | head -1
```

Pre-sorting you should use `grep -cv CB:Z` instead, but it'll be slower as it has to read the entire file then.

Closing this as it's not a bug.  You should still be able to comment on the issue though.
{'source': 'GithubIssues', 'repo_name_with_owner': 'samtools/samtools', 'issue_id': 722752161, 'repo_stars': 1352.0}