Remove use of deprecated Spatialite functions

Spatialite deprecated the use of `spatialite_init` in favour of `spatialite_init_ex` and equivalent functions for cleaning up. See [How to correctly initialize SQLite/SpatiaLite therad safe connections](https://groups.google.com/forum/#!searchin/spatialite-users/spatialite_init_ex/spatialite-users/83SOajOJ2JU/sgi5fuYAVVkJ) on the Spatialite Users list for more info.