Implement UnsavedRevisionDocCache for issue #122

- Instead of porting WeakValueHashMap and integrating with LRUCache,
implement a simple UnsavedRevisionDocCache by using Dictionary right
inside the Database.
- UnsavedRevisionDocCache stores document as a weak reference. The
target object will be checked to validate if the unsaved document is
still in cache. The unsaved document will be removed from the cache
directly when the document.PutProperties method is called to create a
saved revision document.
Cleanup unnecessary null check
Fix null check bug
Using cast instead of as
Merge pull request #237 from couchbaselabs/unsavedrevision_doc_cache

Implement UnsavedRevisionDocCache for issue #122