Upgrade Doctrine to 2.4.

See https://github.com/doctrine/doctrine2/blob/2.4/UPGRADE.md
See https://github.com/doctrine/dbal/blob/2.4/UPGRADE