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>
Allow passing in flags to iv_init().

And use some preprocessor magic to allow calling iv_init() either
with or without a flags argument.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Cache the return value of iv_get_thread_id() in struct iv_state.

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

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