Make libsthtread valgrind-aware.
Without this change, libsthread is initialized twice when using valgrind:
one for the valgrind launcher, and one for the target program.
Use the environment variable VALGRIND_LIB to detect the usage of valgrind,
and don't divert main() when RUNNING_ON_VALGRIND returns 0.
Just hope that noboby has VALGRIND_LIB in its environment without using valgrind.
In this case, the check can be reinforced by looking for the substring "valgrind" in argv[0].
For example, run:
valgrind --trace-children=yes env LD_PRELOAD=./lib/libsthread.so ./examples/sthread/pthread-mutex-simple