Sync session drops with shutdown, fix thread leak.