support axis=None for nanmedian ( issue #7352 )

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