Do not fire watchers when setting existing NaN value to NaN

Fixes #17513.

Backports are needed to 1.6.