Fix crashes due to lost DirectX device (UAC, opening other games, ctrl-alt-del, etc).

This still has a memory leak somewhere, meridian.exe gains 30mb of memory usage every time the device is lost. Putting it up in case someone else knows off-hand where it might be.