fix postgis template creation script for 2.0

Autodetect installed version of postgis. With postgresql 9.1, we now install
postgis 2.0 instead of 1.5. This script is backwards compatible.