clang-format: Don't hang forever when encountering a stray "}" in an @implementation block.

PR18406.