Lava doesn't destroy water it evaporates it into steam. This steam rises high into the atmosphere, cools and condenses into rain which it falls back onto the Earth's surface where it gets hot again, evaporates and rises. This isn't too different than how rain is made today, except that the evaporation process is slower and mostly driven by sunlight, wind, running rivers and by plant transpiration, not as much by a scorching hot surface.
Rain is a very efficient form of heat transfer. Water evaporating very efficiently cools the surface. I read or heard somewhere, don't remember where, so take with a grain of salt, but I heard that the Earth rained constantly for millions of years when the planet was young and the surface was hot.
To thermally split water into Hydrogen and Oxygen, the temperature needs to be about 2,000 degrees C. Lava isn't that hot, though it's possible that the very young earth might have been hot enough to actually destroy some water and turn it into it's elements, Oxygen and Hydrogen, some of which would have recombined, and some of the hydrogen could have been lost as Earth's gravity is too low to retain all of it's hydrogen, but for the most part, Lava doesn't destroy water it simply evaporates it. It's also possible that some other chemical interactions would absorb and change the chemical property of some of the water, but for the most part, Lava just turns water it into steam, which is still water, just in a different state, like how Ice is still water, just not liquid.
On the comments below, that's on the Earth Science/Astronomy border, but there are a fair bit of unknowns on how much atmosphere and water the Earth has lost to the Solar Wind. One estimate says the Earth is losing about 90,000 tons of hydrogen every year. Source. Since that hydrogen effectively comes from split water molecules by UV rays high in the atmosphere and by mass, Water is about 8 parts Oxygen to 1 part hydrogen, then 810,000 tons of water is converted to 720,000 tons of Oxygen every year. If we multiply that by 4 billion, just cause, you know, why not run the numbers, assuming consistency, over that time, the Earth has lost 3,240 trillion tons of water and added 2,880 trillion tons of Oxygen. Consistency is a big if, but these numbers seem reasonable enough to work with.
The oceans contain about 1.4 million trillion tons of water so the estimated 3,240 trillion tons of water lost is irrelevant, less than 1/400th of the Ocean water at the current rate of loss.
Oxygen is different. 2,880 trillion tons of Oxygen is more Oxygen than is currently in the Earth's atmosphere, but much of the Earth Oxygen formed in the upper atmosphere combined with other elements like Iron in the oceans or Methane gas, or helped form the planet's granite, so even though the solar radiation should have produced lots of Oxygen from water over time and Hydrogen that was lost, the amount of water is negligible and the Oxygen has been useful in many ways.
But I digress as those are current estimates not historical ones. The solar wind, while it does blow hydrogen off the Earth and in effect removing water from the Earth, the effect is slow enough that it's a minimal change.
But the Earth's magnetic field wasn't always there and it isn't as old as the early and late heavy bombardment periods. Our magnetic field is thought to be about 3.5 billion years old. Source. So it's entirely possible that the Young Earth lost a significant amount of water prior to the magnetic field. Venus has no magnetic field to speak of but it's retained it's atmosphere's heavy elements but very little of it's water. Mars is much smaller, so it's less good at retaining it's atmosphere than Venus. Nobody knows how much atmosphere and water the young Earth lost to space.
It's entirely possible Earth lost a pretty good share of it's water to the Sun's UV rays prior to it's magnetic field, and in part due to it's high temperature, but I don't think anyone had a good guess on the precise numbers. To return to the question above, Magma on the surface isn't a big factor unless it's hot enough to split water into individual molecules. It's the temperature of the upper atmosphere, the atmospheric escape velocity, the solar wind and magnetic field are the larger factors.