profile: add logging on failure

Add logging to report any failures that may occur on calls to libdl.  Without
this, it is difficult to identify the actual problem if the test fails.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209097 91177308-0d34-0410-b5e6-96231b3b80d8
profile: adjust flags for libdl

dlopen expects that the flags contains RTLD_LAZY or RTLD_NOW.  RTLD_LAZY will
resolve the symbol on first use, and is generally preferred due to efficiency.
Add this to fix the test failure on the build bots.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209098 91177308-0d34-0410-b5e6-96231b3b80d8