Fix problem where nab would not terminate

Make sure all threads terminate when the main thread terminates, either by daemon threads or by being instructed to stop