First of all, stop being an idiot. Your dog was attacked, it's head was in a pitts MOUTH ! anything you have to do, you do. It's very simple, you did not over react, morally you did nothing wrong, legally you did nothing wrong.
Second, yes you may have pinned the dog, but that's a lot less than you could have done, if you had wanted to, be honest, you could have seriously harmed it couldn't you ? BUT you didn't, because even in the split second you had to react, your still a dog lover.
I will be honest, I'm not sure I could have shown the same restraint, so don't beat yourself up about it, you did the right thing, glad Ralph's ok now and well done Maya for staying !