add parameter to set the maximum number of threads in wavelet tree construction