Raise DuplicateKeyError for commands PYTHON-507

Only when appropriate. The findAndModify command
can return duplicate key error when doing an upsert.