Allow hpcrun_dlopen_read_lock() to succeed when the current thread holds the write lock.  This fixes the case of a synchronous override (eg, pthread_create) from inside an init constructor in dlopen().
Allow hpcrun_dlopen_read_lock() to succeed when the current thread
holds the write lock.  This fixes the case of a synchronous override
(eg, pthread_create) from inside an init constructor in dlopen().

This was previously relaxed for requesting the write lock in 8a1f1fa7.
Again, this is allowed because the override comes from the init
constructor, after the dangerous part of dlopen.

HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit