Multi-threading support for adaptive rd threshold

 With these changes multithreading should work for all
 quality/speed presets.