IndexedDB: Failed open calls leak database objects

Noticed by code inspection: if an open call fails because the specified
version is too low, the IndexedDBDatabase instance is retained in the
IndexedDBFactory's map since there's no connection to later release it.
Predicate adding a database to the map on a connection being added.

Also, make factory state test helpers private and use FRIEND_TEST_...()

R=dgrogan@chromium.org
BUG=326264

Review URL: https://codereview.chromium.org/107693004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240185 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 240185