pgsql: Use close callback to reliably react to remote closes.
Configure: fixed test for __attribute__ support

va_start and other macros expect the va_list as first argument.
This test only produced warnings with most compilers, which is
why this problem was never fixed.