Fixed missing new lines and handling of final chunk in sorted vcf output mode