glupy: portability fixes

Fixes portability problems so that NetBSD passes tests/features/glupy.t

- Use python-config to detect python build environment on all systems,
  not just Linux and Darwin.
- Get the site-package directory from python and make sure we install
  glupy.py there, Previously we installed within glusterfs prefix,
  which caused a problem if it was different that python's prefix.
- Set PYTHONPATH for tests so that the detected site-packages is used
  in python's search path. This should be useless, but let us have it
  just in case.
- Pass glupy.so path from glusterfsd to glupy.py through an
  environment variable and use it in CDLL instead of "", as the
  later seems not portable (at least it fails on NetBSD).
- Use gil_init_key pthread_getspecific to avoid deadlocks (that
  code was #ifdef out, perhaps because it was not needed on Linux,
  but it seems to be required for NetBSD.
- Recover the error message from Python and send it to the logs
  to help debugging problems.

Backport of: http://review.gluster.org/8978

This is the same patchset as previously submitted to retrigger regression
tests after a spurious failure.

BUG: 1138897
Change-Id: I1e23ba5cc18f129ee1032f905cb053953b683a81
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8980
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>