I am 17 and have been dating for well over a year now, and I firmly believe that pornography does not help. Though I have little experience in that regard, my tests to see if this would help failed. I believe that since one does separate reality and pornography, any benefits from one do not help with the other.
On the other hand, masturbation could help. Having never tried it, I probably wouldn't be the best person for advice. However, since masturbation is a form of sexual release, it should help prevent a boner. I would still urge you to exercise restraint in doing so, as some people I know are borderline addicted to it.
Also, I would not broach the subject with your girlfriend. most people outwardly say masturbation is wrong, regardless of the reasons for it. Unless you feel she would accept that, I would avoid mentioning it.
Most importantly, avoiding these feelings is easiest to do by varying what one does. If you constantly make out, hug, etc. then the boners will only get worse. If you instead enjoy time in each other's presence, without much physical contact, your body will (most likely) learn to calm itself. I have found this to be the best method.
Hope that helped!