Fix compilation problem for sqlite versions between 3.5.0-3.7.7. ROOT-5318.

Patch provided by Oliver Freyermuth.
The version 1.2.23 of libpng was the built-in version in ROOT. It had some security issuee. Now we have 1.2.50.
cf: https://sft.its.cern.ch/jira/browse/ROOT-5322