JK Rowling did it on purpose.
She purposely created all the hubbub about Harry being killed off. Props to her, it did definitely boost the marketing and make people even more rabid about getting the book. So, mission definitely accomplished. She also definitely succeeded in getting the idea across that anyone was up for grabs in the kill-'im-off spree.
I think I'm going to have to call BS on her that her audience didn't affect who she DIDN'T decide to kill off. Because the fact that she didn't kill any of the major (protagonists off (Harry, Hermione, Ron, Luna, Neville, Hagrid, with the exception of Snape) I felt was a definite nod to her young readership and the fact that lots of people would have been angry had she killed off any of those characters. But as one of my friends so aptly reminded me, Harry Potter is a classic example of a Romantic fairytale. I suppose I never should have really expected any ending other than this sugary one.
That's it for Harry Potter. Moving on to the next of the hundreds waiting for me on my shelf...