Refactor TLS initialization

We now allocate TLS blocks before creating a new thread and then just
set the TLS address once the new thread is started. This avoids having
to handle failure in the thread entry trampoline. Also remove the
separate TLS module IDs and use the image ID instead.