Fix cppcheck reports:

[src/providers/ogr/qgsogrprovider.cpp:1071]: (error) Memory leak: oldlocale
[src/providers/ogr/qgsogrprovider.cpp:1268]: (error) Memory leak: oldlocale
[src/core/spatialite/spatialite.c:50598]: (error) Memory leak: reader
[tests/src/core/testqgscolorscheme.cpp:155]: (error) Memory leak: dummyScheme2
[src/core/spatialite/spatialite.c:40138]: (error) Memory leak: ln