Have a consistent API for errors where the format values are a dict.

Previously, they were sometimes a dict and sometimes needed wrapping
before using. This complicates the API for users, and having hacks
like this in our testsuite is just wonderful.