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

This seemed to be the consensus, so I'll merge tomorrow unless there is a complaint.