support axis=None for nanmedian ( issue #7352 )

This fixes #7352, where ``nanmedian`` does not work when ``axis==None``.