Mann-Whitney isn't sensitive to changes in variance with equal mean, but it can - as you see with the $P(X>Y)=0.5$ form, detect differences that lead $P(X>Y)$ to deviate from $0.5$ (e.g. where both mean and variance increase together). Quite clearly if you had two normals with equal mean, their differences are symmetric about zero. Therefore $P(X>Y) = P(X-Y>0) = \frac{1}{2}$, which is the null situation.
For example, if you have the distribution of $Y$ being exponential with mean $1$ while $X$ has an exponential distribution with mean $k$ (a scale change), the Mann-Whitney is sensitive to that (indeed, taking logs of both sides, its just a location-shift, and the Mann-Whitney is unaffected by monotonic transformation).
--
If you're interested in tests which are conceptually very similar to the Mann-Whitney that are sensitive to differences in spread under equality of medians, there are several such tests.
There's the Siegel-Tukey test and the Ansari-Bradley test, for example, both closely related to the Mann-Whitney-Wilcoxon two sample test.
They are both based on the basic idea of ranking in from the ends.
If you use R, the Ansari-Bradley test is built in ... ?ansari.test
The Siegel-Tukey in effect just does a Mann-Whitney-Wilcoxon test on ranks computed from the sample differently; if you rank the data yourself, you don't really need a separate function for the p-values. Nevertheless, you can find some, as here:
http://www.r-statistics.com/2010/02/siegel-tukey-a-non-parametric-test-for-equality-in-variability-r-code/
--
(in relation to ttnphns' comment under my original answer)
You would be over-interpreting my response to read it as disagreeing with @GregSnow in any particularly substantive sense. There's certainly a difference in emphasis and to some extent in what we're talking about, but I'd be very surprised if there was much real disagreement behind it.
Let's quote Mann and Whitney: "A statistic $U$ depending on the relative ranks of the $x$'s and $y$'s is proposed for testing the hypothesis $f=g$." That's unequivocal; it utterly supports @GregSnow's position.
Now, let's see how the statistic is constructed: "Let $U$ count the number of times a $y$ precedes an $x$." Now if their null is true, the probability of that event is $\frac{1}{2}$ ... but there are other ways to get a probability of 0.5, and in that sense one might construe that the test can work in other circumstances. To the extent that they're estimating a (re-scaled) probability that $Y$>$X$, it supports what I said.
However, for the significance levels to be guaranteed to be exactly correct, you'd need the distribution of $U$ to match the null distribution. That's derived on the assumption that all the permutations of the $X$ and $Y$ group-labels labels to the combined observations under the null were equally likely. This is certainly the case under $f=g$. Exactly as @GregSnow said.
The question is the extent to which this is the case (i.e. that the distribution of the test statistic matches the one derived under the assumption that $f=g$, or approximately so), for the more generally expressed null.
I believe that in many situations that it does; in particular for situations including but more general than the one you describe (two normal populations with the same mean but extremely unequal variance can be generalized quite a bit without altering the resulting distribution based on ranks), I believe that the distribution of the test statistic turns out to have the same distribution under which it was derived and so should be valid there. I did some simulations that seem to support this. However, it won't always be a very useful test (it may have poor power).
I offer no proof that this is the case. I've applied some intuition/hand-wavy argument and also done some basic simulations that suggest it's true -- that the Mann-Whitney works (in that it has the 'right' distribution under the null) much more broadly than when $f=g$.
Make of it what you will, but I don't construe this as substantive disagreement with @GregSnow
Reference - Mann&Whitney's original paper