Use Debug.with_thread_named rather than the manual functions.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>