if a flat earth with a magma bottom accelerated through space and there is no gravity, there is no reason for the magma to stay on the earth
It doesn't always. Sometimes it is pushed through the disk of the earth.
If there is a force pushing on the underside of the earth, and since no system is perfect (entropy) it is reasonable to assume that some of the energy acting on the underside is resulting in heat rather than motion.
Depending on the shape of the underside the liquid magma could be "cupped" in the underside. And that would not be held has flowed past the earth a long time ago.
Also, as you increase pressure, you raise the melting temperature of most materials, if the force is great enough, the magma would be in a high pressure solid, which when the disk of the earth cracks is allowed to depressurize and become liquid, as it erupts to the surface.