Adds a new API routine dr_prepopulate_cache() meant to be called between dr_app_setup() and dr_app_start() to build up a code cache in parallel with app execution, to avoid the cost of a cold cache upon attach.
Fixes some auxiliary issues with building blocks ahead of time from sampling data:
- Sets up TLS during bb building for dcontexts but does not enable signal handlers to avoid perturbing the app.
- Adds is_DR_segment_reader_entry() to avoid pre-building a problematic self-sampled bb that reads DR segments when DR is a static library and we do not support mangling such reads.
- Fixes an initialized-dcontext issue in dr_get_isa_mode().
Adds a test.
Fixes #2463 (closed)