Make charset configuration and init queries event based in AgaviDoctrineDatabase, closes #1181