Split off implementations of iv_thread_get_id() into separate files.

And rename them to iv_get_thread_id() in the process, as these should
not be primitives provided by the iv_thread module.  (We'll provide
backward compatibility wrappers, of course.)

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
iv_thread: Rewrite.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>