Make default_device thread-local

Signed-off-by: Sebastian Ramacher <sramacher@debian.org>