BUG: allow empty dict as proxy for empty struct

Previously passing an empty dict as a value for a matlab array would
raise an error, whereas a dict with valid fields would not.  Allow empty
dicts (and dicts with only invalid fields) by saving them as empty
matlab stucts.

This changes the API somewhat because previously dicts or objects with
no or only invalid fields would raise an error.

Fixes gh-3798
I have a preference for ``np.testing.assert_``, which is already imported.