Postgis 3.1, timescale 2.0 and a few optimizations in relinking of extensions/contribs (#535)
Postgis 3.1, timescale 2.0 and a few optimizations in relinking of extensions/contribs (#535)

1. Fix build broken by postgis 3.1 release
   - use postgis 3.1 as main version
   - use postgis 3.0 as legacy version (postgres 9.5)
   - fix relinking code to support legacy postgis and optimize it to support relinking between all major versions, not only the current one.
2.  Bump version of timescaledb to 2.0
    - change cmake requirement from 3.11 to 3.11 in CMakeLists.txt. The old version available in ubuntu 18.04 perfectly works.
    - call bootstrap with -DWARNINGS_AS_ERRORS=OFF
    - 9.6 and 10 will continue using 1.7.4, therefore optimized relinking code in the commit updating postgis becomes very handy.
3. A bit unrelated, but since this PR already does a lot of housekeeping, optimize the code defining/cleaning locales in order to reduce the number of repetitions.

Close: #528, #529, #534, #533
zalando/spilo,zalando/spilo,zalando/spilo