Improve GiST index search performance for trigram regex queries.

The initial coding just descended the index if any of the target trigrams
were possibly present at the next level down.  But actually we can apply
trigramsMatchGraph() so as to take advantage of AND requirements when there
are some.  The input data might contain false positive matches, but that
can only result in a false positive result, not false negative, so it's
safe to do it this way.

Alexander Korotkov
Correct handling of NULL arguments in json funcs.

Per gripe from Tom Lane.
Mark json IO and extraction functions immutable.

Per complaint from Hubert Depesz Lubaczewski.

Catalog version bumped.
Fix function return type confusion

When parse_hba_line's return type was changed from bool to a pointer,
the MANDATORY_AUTH_ARG macro wasn't adjusted.