sort-bed: fixed issue that broke --max-mem with large #s of distinct chromosomes.  also cleaned up some memory leak problems