Prevent castling through and out-of check.