Fix view hierarchy debugging with complex key paths

Previously, key paths given to the view hierarchy debugger would only work if they had a single component (i.e. "frame"). Support for multi-component key paths (i.e. "_viewDelegate.title") was almost complete, but failed when inferring the type encoding for the key path. This change correctly gets the type encoding for both the simple case and the complex case.