Fix-crash in scan grad when compute_test_value=raise

fix gh-1385

NEWS.txt:
- Fix-crash in scan grad when compute_test_value=raise (Frederic B., reported by Bitton Tenessi)