Ensure that we send close.ok before releasing channel ids
merge bug25509 into junk