Update closure and thread APIs in tests.

I'm not particularly well versed in this stuff, but I think this is fine. I didn't observe the double-drop behaviour mentioned in the comments - has that been fixed?