BUG: Attributes skipped when serialising plain Python objects to JSON (#42768)
This patch closes #42768 and fixes a previously-reported issue #33043.

When `ujson` falls back to encoding a Python object, it iterates over all of the non-callable attributes of the object which do not start with an underscore, using them as JSON keys. While iterating the `dirs(obj)` list, an index was incremented twice causing every second attribute to be skipped.

I've fixed this increment, and moved some of the declarations inside the function so that control flow is more clear. I've also added a regression test for this behaviour.

- [x] closes #42768
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry

This patch also xref #41174, but I'm not sure that turning complex numbers into `{"real": ..., "imag": ...}` JSON objects was intended in the first place, so I haven't added a test for this.