Fixed a bug in the ``np.average`` function when weights with units and a
different shape to the input array were passed and the optionally-returned sum
of the weights was requested. The sum of the weights now has correct units.
