Merge "Improve handling of daemon threads after runtime shutdown"