1. Static linking - Added KTE_STATIC_LINK CMake option and
disabled it in default.nix to avoid the "attempted
static link of dynamic object" error
2. Missing include - Added <cstring> to
test_swap_edge_cases.cc for std::memset/std::memcpy (GCC
14 is stricter about transitive includes)
- Introduced `test_swap_edge_cases.cc` with extensive tests for minimum payload sizes, truncated payloads, data overflows, unsupported encoding versions, CRC mismatches, and mixed valid/invalid records to ensure reliability under complex scenarios.
- Enhanced `main.cc` with a top-level exception handler to prevent data loss and ensure cleanup during unexpected failures.