ssa.c: Skip PRDB calculation in case of SMDB update in process

Problems:
Access can receive SSA_CONN_DONE message from downstream while
an SMDB update is in process. Access could crash because it may
touch SMDB during updating since PRDB calculation requires a
stable SMDB.
Also, downstream doesn't accept incoming ACM connection in case
of waiting for SMDB update. It checks Access's state using flags
access_update_pending and access_update_waiting. Access may
change the state after the flags checking, but before the
SSA_CONN_DONE message processing.

Solution:
1. Access will check the flags before PRDB calculation. The
   flags can only be changed in Access thread. So, Access knows
   that there is no SMDB updating at the time.
2. If Access is waiting for SMDB update, it skips the PRDB
   calculation but adds a new consumer to the internal list.
   Only Access touches this data structure.
   PRDB for the new consumer will be computed when ongoing
   SMDB update is indicated by receipt of SSA_DB_UPDATE message.
3. Downstream accepts new PRDB connection even if SMDB update
   is in process.

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Remove no longer needed log message in ssa_downstream_svc_server

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Revert patches related to prdb_calc_in_progress and update pending (for SMDB) in access layer

These changes are not needed going forward.

Following 4 patches were reverted as part of this patch:

commit 3d8311f15fd8abda2ffa36f0eb660053ddc9af66
Author: Hal Rosenstock <hal@mellanox.com>
Date:   Fri Oct 17 14:56:36 2014 +0200

    ssa.c: Remove unneeded argument from ssa_access_smdb_update_ready internal A

    Signed-off-by: Hal Rosenstock <hal@mellanox.com>

commit 44f4f671adec659e5c381a8da055fd5a4f20f7a9
Author: Hal Rosenstock <hal@mellanox.com>
Date:   Fri Oct 17 14:46:30 2014 +0200

    ssa.c: Support prdb_calc_in_progress and update pending on SSA_CONN_DONE mes

    Signed-off-by: Hal Rosenstock <hal@mellanox.com>

commit e6ab752419b1050a99d16cd04ca50eebe5fdcce8
Author: Hal Rosenstock <hal@mellanox.com>
Date:   Fri Oct 17 14:14:12 2014 +0200

    ssa.c: Support update pending (for SMDB) in access layer

    Change ssa_downstream_smdb_update_ready to return 1 if PRDB calculation
    is in progress

    Access will send DB update ready message to extract/core threads
    when appropriate.

    Signed-off-by: Hal Rosenstock <hal@mellanox.com>

commit f25a1142ab591e963f98f8d4248783935f62502c
Author: Hal Rosenstock <hal@mellanox.com>
Date:   Thu Oct 16 19:14:04 2014 +0200

    ssa.c: Add prdb_calc_in_progress flag into ssa_access_handler

    when PRDBs are being recalculated due to SMDB update

    Signed-off-by: Hal Rosenstock <hal@mellanox.com>

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa_log.c: Set flog pointer to NULL after close.
ssa_log.c: Avoid closing stderr or stdout.

 SSA may use stderr or stdout for log. If an application
 use stderr or stdout after, this will likely crash the application
 in unexpected way.
cleanup: Move ssa log closing after cleanup
Revert "plugin/configure.ac: Removed no longer needed glib check

This reverts commit 5bcf3b8ef987fa78aad295abd4ae32fdfbe681a2.
configure: Add Glib checking to ibacm and ibssa applications.
configure: Add check for g_thread_init functions

 AC_CHECK_LIB adds to dependences necessary for g_thread_init.
 The function's dependency is different from other Glib's
 threading routines.
Makefile: Add Glib support to Makefiles
ssa.c: Initialize the Glib thread subsystem.
ssa.c: Create Glib pthread pool for rclose.
ssa.c: Add logging to g_rclose_callback
ssa.c: Push rclose to thread pool
ssa.c: Report in ssa_cleanup number of rsocket waiting for close.