The number of millionaires in Boston has risen 50% in the last decade to more than 40,000, putting the city seventh nationally and 26th worldwide.