I have a similar issue - when I hit my phone screen with a hammer it shutters.
Seriously, what did you expect? Either pull the phones out all the way, or leave them in. Jerking them in the jack will cause false triggering of play. That button on the headphones that stops/starts playback sends its signal via the same wires, so when you play around with that jack you may be triggering false "button presses".
If you cannot comfortably remove the headphones from the phone without triggering the playback, then the phone or headphones are faulty.