Avoid recursion when constructing unexpected invocation message.

When an unexpected invocation occurs, we try to construct a detailed message
for the exception. If the construction of this message itself results in
another unexpected invocation then we should attempt to construct a simpler
version of the message for the original unexpected invocation.

Fixes #168.