Congratulations on an amazing swim well done! Secondly, I agree with the others. Don't beat yourself up over how your stroke broke down. It happens to all of us in ow at some point. The most important things to remember is that it is a good learning tool (i.e. the race) for next time. Katie K is absolutely right, you need more experience in an ow setting. The lake is fine but take on tougher conditions or swim with friends who can simulate a race experience for you in the water. The pool is good for technique and speed, but even sighting should be done more often in open water. How many times do you need to sight in a pool?
Lastly about your time. There is a motto in ow that we all abide by and you should to. It doesn't matter what time you finished only that you did! Learn that very well and get back in the water and prepare for your next race! Congrats again!