new patches related to the previous nine:handle D3DISSUE_END without previous D3DISSUE_BEGIN

I don't expect 69880a1 to be ready yet, as there are probably some cleanups or cases I did not see.
Axel, it is a little more complicated than we discussed, as I added the check also for D3DISSUE_BEGIN, and so I moved that to a function, that I'd like to move out of nine (unless one already exists and does the same thing).

As for the other one, it's fairly simple, but again I'm not sure if it has everything needed.

John