Update UnitOfWork.php

Only the fix from pull request #95
Merge pull request #96 from ROMOPAT/patch-1

Update UnitOfWork.php
Merge pull request #3 from doctrine/master

Updates from doctrine/couchdb-odm