Fix the data race on pb.isFinish member.
Fix the data race on pb.isFinish member.

There's potential race between Finish() setting pb.IsFinish = true and
writer() which does pb.isFinish check on each iteration. This has been
discovered by Go race detector.

Fix is ugly, as it changes bool to int32 and uses atomic operations
to close the race.

satelliz/pb,charignon/pb,cheggaaa/pb,0x00evil/pb,harshavardhana/pb,gaowenbin/pb,mvo5/golang-pb,guaiguaihw/pb,sevki/pb,yh453926638/pb