Don't use dir in get_obj_perms_model

Using the `dir` function in `get_obj_perms_model` is very wrong as there might be attributes (like updated tests show) that are not valid fields but have `related.model` attribute available. Using model introspection via `_meta` is the correct way to handle this which is what this pull request fixes.