Compile as shared library by default.

This patch compiles the pgm library to a shared library (.so)
instead of a static library (.a).
Replace x86 membarriers with GCC built-ins

This patch replaces the x86 asm memory barriers with
mostly platform-independent GCC built-ins. Beware though:
I've once seen __sync_synchronize() fail to generate
a barrier on MacOS X (Darwin)---maybe it could happen
again on another platform.
Handle mult. init*process_local() calls gracefully

Thie patch allows pgm_init_process_local() to return a
different error code (+1) if pgm already initialized. -1
still indicates error.