Fix memleak on D3D9 shutdown & restart with lost device