Release the proc and thread properly after quit.