I am surprised that nobody mentioned the Math Reviews authors database.
Currently it has about 650000 authors. I suppose that about 50% of them are dead, which gives an estimate of 300-400 K living mathematicians. Of course, as it was noticed in the question, it is hard to establish a criterion, whom do we call mathematicians. I think about 1/3 or 1/2 of the people in this database are those who published only one paper.
Such sources as Math Genealogy project are much less reliable, because they do not include most Soviet, Chinese and other mathematicians. But it also includes people who defended a PhD in mathematics, published one paper (or even did not publish anything) and switched to some other activity.