Do not fire watchers when setting existing NaN value to NaN

Fixes #17513.
(cherry picked from commit 531b8f46acc8acba87d55a0338649bfc30ae58c9)