Fix atomicity of Participant.cancel() method

Follow-on from #2479.