[XCTest] Reduce bridging overhead from the exception-catching trampoline
By returning `nil` instead of an empty dictionary in the common case where
no exception is encountered, we skip any dictionary-bridging work which
can become expensive if making assertions in a tight loop.