[Core] Added bels's code from M3 to disable exceptions testing on FreeBSD, since the tests hang or fail and don't allow compilation.