Scattering of Energetic Electrons by Heat-flux-driven Whistlers in Flares