Fix an ancient error in dist_ps (distance from point to line segment), which a number of other geometric operators also depend on.  It miscalculated the slope of the perpendicular to the given line segment anytime that slope was other than 0, infinite, or +/-1.  In some cases the error would be masked because the true closest point on the line segment was one of its endpoints rather than the intersection point, but in other cases it could give an arbitrarily bad answer.  Per bug #4872 from Nick Roosevelt.
Fix an ancient error in dist_ps (distance from point to line segment), which
a number of other geometric operators also depend on.  It miscalculated the
slope of the perpendicular to the given line segment anytime that slope was
other than 0, infinite, or +/-1.  In some cases the error would be masked
because the true closest point on the line segment was one of its endpoints
rather than the intersection point, but in other cases it could give an
arbitrarily bad answer.  Per bug #4872 from Nick Roosevelt.

Bug goes clear back to Berkeley days, so patch all supported branches.
Make a couple of cosmetic adjustments while at it.

edespino/gpdb,greenplum-db/gpdb,ovr/postgres-xl,techdragon/Postgres-XL,ashwinstar/gpdb,greenplum-db/gpdb,Chibin/gpdb,jmcatamney/gpdb,Postgres-XL/Postgres-XL,yazun/postgres-xl,tpostgres-projects/tPostgres,edespino/gpdb,ashwinstar/gpdb,lisakowen/gpdb,ashwinstar/gpdb,lisakowen/gpdb,edespino/gpdb,xinzweb/gpdb,adam8157/gpdb,pavanvd/postgres-xl,techdragon/Postgres-XL,adam8157/gpdb,kmjungersen/PostgresXL,Chibin/gpdb,yazun/postgres-xl,arcivanov/postgres-xl,oberstet/postgres-xl,yuanzhao/gpdb,lisakowen/gpdb,snaga/postgres-xl,Postgres-XL/Postgres-XL,jmcatamney/gpdb,pavanvd/postgres-xl,tpostgres-projects/tPostgres,edespino/gpdb,xinzweb/gpdb,50wu/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,yazun/postgres-xl,postmind-net/postgres-xl,ovr/postgres-xl,edespino/gpdb,oberstet/postgres-xl,arcivanov/postgres-xl,kmjungersen/PostgresXL,adam8157/gpdb,50wu/gpdb,snaga/postgres-xl,kmjungersen/PostgresXL,Chibin/gpdb,50wu/gpdb,tpostgres-projects/tPostgres,postmind-net/postgres-xl,lisakowen/gpdb,lisakowen/gpdb,greenplum-db/gpdb,Chibin/gpdb,jmcatamney/gpdb,lisakowen/gpdb,pavanvd/postgres-xl,adam8157/gpdb,50wu/gpdb,techdragon/Postgres-XL,kmjungersen/PostgresXL,xinzweb/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,Chibin/gpdb,yuanzhao/gpdb,jmcatamney/gpdb,lisakowen/gpdb,50wu/gpdb,adam8157/gpdb,zeroae/postgres-xl,ashwinstar/gpdb,50wu/gpdb,greenplum-db/gpdb,lisakowen/gpdb,arcivanov/postgres-xl,snaga/postgres-xl,yuanzhao/gpdb,adam8157/gpdb,Postgres-XL/Postgres-XL,pavanvd/postgres-xl,zeroae/postgres-xl,yazun/postgres-xl,jmcatamney/gpdb,yuanzhao/gpdb,50wu/gpdb,Postgres-XL/Postgres-XL,xinzweb/gpdb,postmind-net/postgres-xl,edespino/gpdb,yuanzhao/gpdb,Chibin/gpdb,oberstet/postgres-xl,xinzweb/gpdb,ovr/postgres-xl,oberstet/postgres-xl,tpostgres-projects/tPostgres,arcivanov/postgres-xl,yuanzhao/gpdb,greenplum-db/gpdb,yazun/postgres-xl,Postgres-XL/Postgres-XL,Chibin/gpdb,arcivanov/postgres-xl,greenplum-db/gpdb,yuanzhao/gpdb,snaga/postgres-xl,Chibin/gpdb,jmcatamney/gpdb,arcivanov/postgres-xl,50wu/gpdb,ashwinstar/gpdb,xinzweb/gpdb,techdragon/Postgres-XL,edespino/gpdb,greenplum-db/gpdb,xinzweb/gpdb,zeroae/postgres-xl,zeroae/postgres-xl,tpostgres-projects/tPostgres,jmcatamney/gpdb,jmcatamney/gpdb,zeroae/postgres-xl,ashwinstar/gpdb,adam8157/gpdb,kmjungersen/PostgresXL,oberstet/postgres-xl,Chibin/gpdb,postmind-net/postgres-xl,pavanvd/postgres-xl,adam8157/gpdb,snaga/postgres-xl,edespino/gpdb,edespino/gpdb,yuanzhao/gpdb,Chibin/gpdb,ovr/postgres-xl,ovr/postgres-xl,xinzweb/gpdb,postmind-net/postgres-xl,edespino/gpdb,techdragon/Postgres-XL,yuanzhao/gpdb