dlopen using RTLD_GLOBAL

This is a change that is needed to get my python pr #983 working correctly on Linux. It's the same problem as described in this julia bug report: https://github.com/JuliaLang/julia/issues/2312 and this python bug: http://bugs.python.org/issue19153

I'm 99% certain that always using the RTLD_GLOBAL flag should be perfectly fine and not disturb anything else. But if it does, then we can add some api to let the user decide what dlopen flags to pass.