Issue title: assert in terminal_test with Archlinux's default flag
 Issue body: <!--## Prerequisites

- Many many thanks for taking part in this community, we really appreciate that.
- Please make sure this issue you are facing isn't already reported.
- It would be really nice if you can confirm that this issue is reproducible with the latest Contour version from the release page or ideally master branch; however, this isn't a hard requirement for reporting bugs.
-->

## Description
```
$ ./build/src/terminal/terminal_test
/usr/include/c++/11.2.0/bits/stl_algo.h:3658: constexpr const _Tp& st38d1:d2b4:3d06:83e8:96a5:8c2:893d:aba5clamp(const _Tp&, const _Tp&, const _Tp&) [with _Tp = int]: Assertion '!(__hi < __lo)' failed.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
terminal_test is a Catch v3.0.0-preview.3 host application.
Run with -? for options

Randomness seeded to: 23014433

-------------------------------------------------------------------------------
captureBuffer
  lines: 0
-------------------------------------------------------------------------------
/home/vl/Downloads/contour/src/terminal/Screen_test.cpp:1753
...............................................................................

/home/vl/Downloads/contour/src/terminal/Screen_test.cpp:1753: FAILED:
due to a fatal error condition:
  SIGABRT - Abort (abnormal termination) signal

===============================================================================
test cases:  89 |  88 passed | 1 failed
assertions: 837 | 836 passed | 1 failed

[1]    48465 abort (core dumped)  ./build/src/terminal/terminal_test
```

The default flag `-Wp,-D_GLIBCXX_ASSERTIONS` causing assertion.
maybe add a ci for that kind of thing

test-assert.patch
```patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b962666..27f7d98 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,6 +14,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)
 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wp,-D_GLIBCXX_ASSERTIONS")
+
 if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
   set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE
     STRING "Choose the build mode." FORCE)
```

## Environment

- Git commit hash: 61263c7a75c8624a2d0f5ddad248c2225be616f6
- Operating System: Archlinux
- Contour configuration: default one

## Steps to Reproduce
```
git clone https://github.com/contour-terminal/contour.git
cd contour
patch -Np1 -i test-assert.patch
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release
cmake --build build
./build/src/terminal/terminal_test
```

 Comments: 
 Comment 0: Wow. Nice catch! Many thanks @vnepogodin.

Also thanks for the `D_GLIBCXX_ASSERTIONS` tip.
{'source': 'GithubIssues', 'repo_name_with_owner': 'contour-terminal/contour', 'issue_id': 1040487687, 'repo_stars': 635.0}