Pass thread instead of loop to loop_resume()

The API feels more consistent when passing the same value to both the
block and resume functions.