How to convert bwa mem output to BAM format without saving SAM file
For directly outputting a sorted bam file you can use the following:

bwa mem genome.fa reads.fastq | samtools sort -o output.bam -


Optionally using multiple threads:

bwa mem -t 8 genome.fa reads.fastq | samtools sort -@8 -o output.bam -