Sylvain Guintoli was the surprise winner of Race 2 at Assen as the British Superbikes season moved closer to its finale at Brands Hatch.