By my reading, the set of conflicts can change between line 52, line 57 and the database block by concurrent updates. This means that the winning revision by the time we're in the database block might not be in the `revsArray` above. It also means that a call to this method can return `YES` but the document is still in conflict when you leave the method (as there may still be active revs because we only delete those that are present at the start of the method), which is counter-intuitive.

I think that the `-activeRevisionsForDocumentId` and `-resolve:conflicts:` calls need to be inside the transaction. Unfortunately this is going to necessitate more `inDatabase:` methods, I think.