Add hooks for database open and pragma handling

Change-Id: Icb4e52885cc4b35ffdb09b32dd0bd9975a632d7c
SQLite: Updated hooks for database open and close.

Change-Id: I38135eaed3b5e66ef302eb0337f1bf3ba9f184d7
Introduce USER_HAS_PRIVATE_CFX_REPOS