Return NaN for median of vectors containing NaN. Closes #6486