Close AL while safely ending the threads.