If a tool slot doesn't have a brush assigned the tool system will try and look up a brush with the right name. However it doesn't check if the returned brush actually belongs to the active paint mode; this patch fixes that.
Brings behavior in line with the brush select operator.