fix prematurely released lock when uploading partial result