Fix std.exception.ifThrown tests in release mode.

As the unit test is not `@safe`, bounds checking is disabled
when building with -release.