Detect more postgresql versions.

 - Also accept versions ending in "beta\d+"

 - Thanks to Joar Jegleim for posting a fix on his blog, and Luc
   Maisonobe for bringing it to our attention via the Debian BTS.
Merge branch 'bts/762904-postgresql-version' into stable-2.0