MAYBE it was kept locked from her, but my spidey senses say no on that one. Guns were never kept in a safe at my home growing up, and there were many of them, but they were all secured from me being able to function them until I was old and mature enough to handle them properly (regardless of the fact that I could have disassembled and reassembled every firearm in the house, and knew every fact and function of each of them by the time I was this girl's age).
And guess what else? I was never made to wear a bike helmet growing up, as were none of my friends. Everyone was fine, until one day I wrecked and cracked the top/side of my head open. I nearly died, and I'll have a bald spot on my head for the rest of my life to remind me that a helmet might have helped. My children will wear a helmet until they're old enough to make their own decisions.
Just as a bike helmet or seat belts are now considered the norm to ensure our children's safety (for any reasonable, responsible guardian), because of the stupid things that might happen (yes, I said MIGHT, but are you really willing to live with the alternative?), securing your firearms from your youngsters is just a smart move. You can tell me your 13 year old is as mature as you want to, but the allure of showing his buddy dad's gun is pretty strong, and comes with some possible consequences, some of which I'm just not willing to live with.
Now, I think it's wonderful this girl was able to defend herself. But luck had a whole lot more to do with this than solid parenting.
If when she called Mom, she gave the girl the code to the safe and then she retrieved the gun, OK (still should have trained her how to use it, she was certainly old enough).
BUT, maybe some other steps could have been taken, such as the girl not being alone at 12, more secure doors, or any number of things, none of which require your little girl to take a man's life.
Say what you want, the whole situation BEFORE the BG showed up (being completely Mom's responsibility) should have never been.