The key to this question is to note that gunpowder doesn't technically explode -- it deflagrates. It doesn't have a super-sonic explosion, but rather a sub-sonic burn. To get the powerful kick needed to project a rifle or handgun bullet, we rely on the fact that gunpowder burns faster in a confined space. The tighter the space, the more temperature and pressure it can achieve.
Fired properly, the gunpowder is confined by the barrel, permitting it to reach the high pressures of a gun shot. Outside of a barrel, the brass case holding the gunpowder and the lightly set bullet provides surprisingly little containment. One can "cook off" a bullet over a fire, and the result is sudden and surprising, but far from lethal.
A single spark on the outside of the case would have a hard time setting off a bullet. Having done this once in a controlled setting to test the safety of such a bullet, it can take several seconds over the top of a torch to reach the critical temperature to deflagrate. A lone spark may have trouble. However, if your pyrokinetic can put the spark on the inside of the bullet, that'd be a very different story. That would be remarkably similar to what the primer actually does when firing the gun!
As mentioned earlier, the bullet would most certainly not escape the magazine. Most magazines are made of steel, and many tests will show just how little momentum the bullet actually picks up. Most of the time it's just shoved out of the case just far enough to give the gunpowder room to burn. However, we have to recognize that this is still a confined space inside the handle of the gun. While it's not as small and well structured as the space inside a barrel, the gunpowder is still going to have to find an exit. It will build up pressure until it does find enough of an exit. This could be enough to cause damage.
The particular behavior is very dependent on the particular handgun and its construction. A revolver would most likely just shove the bullet out of the front of the cylinder, with little to no damage. An all steel handgun like a 1911, however, may contain the pressure better. This means it may fail in a more spectacular way. The small clip that holds the magazine into the gun would be my guess for "first to fail," causing the entire clip to pop out of the gun. If you had a "plastic" gun like a Glock 19, you could be in worse trouble. The bullets in the magazine are held in by a similar pin, but there's open access from the magazine to pressurize plastic all over. There's a decent chance that the force of the powder could rupture the plastic around the bottom edge of the slide (which is typically at a particularly nasty position for spraying plastic bits all over the gun's wielder).
Another question would be what happens to the other bullets? Depending on the exact mechanics of the rupture, you might push one of the other bullets out of the way, exposing another case full of gunpowder. This would create a much larger effect, though it's not immediately clear what sort of mechanical topologies might cause this.
Ironically, rifle bullets might have a less extreme effect than handgun bullets. Many rifle calibers involve a large chamber for powder necked down to a smaller bullet. In a barrel that is shaped for this, this allows for devastating power. However, in a magazine, that space would simply be expansion room for the burning powder. That extra expansion room may keep the pressure down enough that the rifle round may never reach the high pressures that could cause serious damage to the handgun, despite having more gunpowder to work with.
All in all, I don't recommend experimenting to find the answer =) While there's still squabbling over whether guns kill people or people kill people, everyone agrees that a misfired gun is a dangerous device and must be treated with respect until the misfire is resolved.
Edit - From a long discussion in comments, it looks like the question of revolver rounds is of interest. Thanks to Deolater and Supercat for tugging at this thread, and Supercat for bringing data to the table!
The key equation for determining the speed of a bullet is $F=p\cdot A$, the force propelling a bullet forward is the pressure behind the bullet times the cross sectional area of the bullet. Using the formula for work: $W=\int_0^LF\, dx$ where L is the length of the barrel, we can do some comparisons. Then, knowing that $E=\frac{1}{2}mv^2$, we can back out the velocity by noting that the velocity is proportional to the square root of E ($v\varpropto \sqrt E$)
We can consider two idealized cases for the powder burning. The first assumes constant pressure, and the second assumes the powder burns all at once, maximizing pressure at first. A realistic bullet will fall between one of these two extreme cases based on how fast the powder burns.
In the case of a constant pressure, we see $W=\int_0^LpA\, dx$ and thus $W \varpropto L$, where L is the length of the barrel. This means that $v \varpropto \sqrt L$ for the constant pressure case. In the case of an instantaneous burn, the pressure behind the bullet will obey some $p(x)=\frac{P_0}{x+C}$ where $P_0$ is the pressure at the start and $C$ is a constant capturing how much space is behind the bullet where pressure can be built before the bullet starts moving. This gives $W=\int_0^L\frac{P_0}{x+C}A\, dx$. If we cleverly choose units of length such that $C=1$ and thus $W\varpropto \ln(L+1)$.
Now we can put some numbers to this. Thanks to supercat's find, we have a table for a .375 magnum. Now .357 is rather convenient in that $C$ is roughly 1 inch (the case is 1.29" and the bullet rests a bit inside, so 1" is actually probably very close to correct). If the powder were to burn with a constant pressure, the energy after moving 1/2" (escaping the edge of the chamber) would be 1/12th that of the energy when escaping a 6" barrel, and thus a velocity that was .00694 that of the 6" barrel shot. This would put its velocity around 10fps. If we instead assume an instantaneous burn, we can use the second set of equations to see that the energy would be about 20.8% of the energy escaping a 6" barrel. This second equation would instead put its velocity at 65fps. The actual speed would be somewhere between these extreme assumptions.
Sure enough, if we graph muzzle velocity from the page of .357 data, we see a sharp knee in the curve as the barrel length gets smaller. The data doesn't go below 2", but extrapolating the lines confirms that the velocity exiting the chamber would be very small with respect to that of a properly fired bullet.