Not all things callable have an im_self, so harden the test logic against that. getattr(,,None) is the closest to ?. we have in Python, so use that

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