This is the first of the series of commits to import PostgreSQL's exception and memory manager in pgpool.
This checkin includes the following items.

1-- Exception manager API of Postgres is added to pgpool, The API consists of elog.c and elog.h files.
Since this API is very extensive and is designed for PostgreSQL, So to fit it properly into pgpool I have
modified it a little bit, and most of the modifications are related to removal of code which is not required for pgpool.

2-- Added on_proc_exit callback mechanism of Postgres. To facilitate the cleanup at exit time.

3-- Added PostgreSQL's memory manager (palloc API). This includes the client side palloc functions placed in 'src/tools' directory (fe_memutils)

4-- Removed the existing memory manager which was very minimalistic and was not integrated in all parts of the code.

5-- The checkin also refectors some portions of code to make the code more readable at first glance. That includes

-- Dividing the main.c file into two files main.c and pgpool_main.c, Now the main.c file only contains the code
related to early initialisations of pgpool and parsing of the command line options.
The actual logic of the pgpool main process is moved to new pgpool_main.c file.
-- Breaking up some large functions in child.c into smaller functions.
-- Rewrite the pgpool's main loop logic to make the code more readable.

Remaining TODOs on this front.

1-- The current checkin only integrates the memory and exception manager in main process and connection creation
segment of pgpool child process. And the next TODO is to integrate it in pcp and worker child process.

2-- Integration of newly added API into query processor logic in child processes.

3-- elog.c and elog.h files needs some cleanups and changes (To remove unwanted functions and data members of ErrorData structure).
Integrating the exception and memory manager in pcp child process
Add description that it is recommended to specify multiple servers to trusted_servers
Fix uninitialized variable in error case in pool_do_auth().

If there's no valid backend, pgpool will return garbage pid to
frontend in auth phase. Actually because no backend is available,
frontend will be disconnected later on. So this is not harmless.
Per Coverity report "1127331 Uninitialized scalar variable".
Remove unused code.

Per Coverity report #1111487 "Uninitialized pointer read".
Fix to add node id range check when issue an error message using node id.

Per Coverity report #1111433 "Out-of-bounds read".
Fix buffer overrun bug and resource leak bug of parse_copy_data().

Per Coverity report 1111427 "Out-of-bounds write" and 1111453
"Resource leak".
Fix possible segfault in CopyDataRaws().

Coverity pointed out that if pool_get_id() returns an error,
VALID_BACKEND will access out of array.  Per Coverity report 1111413
"Memory - illegal accesses".
Fix query cache is enabled and protocol version = 2 case.

When the protocol version = 2, we assume that session state is "idle".
This is not feasible but no way. I recommend to not use query cache
with protocol 2.
Per Coverity report 1111488 "Uninitialized scalar variable".
Fix uninialized variables when all nodes are down.

Per Coverity report 1111489 and 1111490.
Fix buffer overrun when ps string is longer than 1023.

In reality this could hardly occur, but bug is a bug.
Per Coverity report 1111427 "Out-of-bounds write".
Fix read_kind_from_backend() possible segfault when all backend down.

Per Coverity report 1111414 "Negative array index read".
Fix pool_send_severity_message(). Message buffer is 1 byte small.

Per Coverity report 1111432 "Out-of-bounds access".
Fix strftime() usage in pool_pools().

The buffer is not large enough as expected by the second parameter.
This is not harmless because the format string will not produce longer
result string than the buffer.

Per Coverity report 1111426 "Out-of-bounds access".
Some more on integration of exception and memory manager front.
The current checkin includes creation of per loop iteration memory context for
worker child process, and integration of above in some parts of query processing logics.
For the query processing function all my current code browsing leads me to the
believe that although "pool_process_query()" caller has handled five possible
return values from the function i.e POOL_END, POOL_ERROR, POOL_FATAL,
POOL_IDLE and POOL_CONTINUE, but in actual the function returns only POOL_END,
POOL_ERROR and the success which is POOL_CONTINUE. and to squeeze in the managers
in query processing function I am moving forward with the above mentioned assumption.
Finally the checkin puts the wrapper on pool_read function, "pool_read_with_error()"
which throws an ereport instead of returning -ve status in case of an error.
And this wrapper will live till the time when all the callers of pool_read()
will be decorated with the exception manager.
Improved to specify the versions of pgool-II and PostgreSQL

Conflicts:

	pgpool.spec
Fix resource leak in make_persistent_db_connection.

For this pupose, new static function
free_persisten_db_connection_memory is added.
Per Coverity report #1111468.
Changed the name format of installer package like "installer-pg93-3.3.2.tar.gz"
Fix a bug that connection check to trusted servers fails when the RTT is very short
Prepare 3.3.2