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

As a more general alternative to my #2317 patch (to fix #2312), this patch makes *all* `dlopen` flags available in Julia: it adds an optional argument

    dlopen(libfile::String [, flags::Integer])

where the second argument is a bitwise-or of RTLD flags, which defaults to `RTLD_LAZY|RTLD_DEEPBIND|RTLD_LOCAL`.

So, a library can be opened for global access via `dlopen(libfile, RTLD_LAZY|RTLD_DEEPBIND|RTLD_GLOBAL)`.

Note that if a flag is not supported on the running platform (e.g. Windows), it is simply ignored.