finish optimistic retry code detect collision
upsert bugfixes and tests

* mongo_driver native upsert returns insertedId
* minimongo doesn't use query _id on upsert/replace
* minimongo supports insertedId option
* tests for all this
remove duplicate function
upsert method -- let upsert go over the network

Only works in insecure mode.  (Not supported by allow/deny.)