add optional RTLD flags argument to dlopen, fixes issue #2312
if we are exposing glibc flags then we should expose MacOS flags (RTLD_FIRST) as well
Merge pull request #2380 from stevengj/dlopen_flags

add optional RTLD flags argument to dlopen, fixes issue #2312