I don't know much about the DM test (I'm not one), but I do know a thing or two about swimming in general (I'm a swimming instructor and lifeguard trainer).
I've had quite a few strong young bucks who failed the lifeguard distance swim on the first try. On more than one occassion, I was assigned to "teach them to swim". Now these young men knew the basics, but they had terrible form and therefore exhausted themselves before finishing the test. After only one full day of teaching them basic hydrodynamics, they were able to complete the requisite swim easily. I also stressed that they should relax during the swim and not fight it. Tension robs muscles of stamina and interrupts normal breathing patterns, thus exacerbating the problem.
If you have been training, I tend to doubt that leg strength is the problem. Form and state of relaxation may very well be key issues. Just from the things you have said, I can tell that you are extremely anxious about the test. Try your best to calm yourself and decrease your stress level. Think about your streamlining and move through the water as easily as possible, gliding as much as possible with each kick and keeping your arms tucked (if you are not required to use them). If you are required to use your arms, clear the water with them on your body rotation and extend fully on each stroke.
Thassalamania has it right. Part of the reason he didn't have trouble with his swim was his comfort level. Strive to achieve the same mental attitude.
Hope this helps. I wish you well.