Same problem here on an iMac (late 2012). Last week the headphone jack occasionally popped out the socket. Then one day it just cracked and was pushed inwards.
Went to a Apple retailer and they said I could return it to an Apple store. When it's proven it's not because of bad use (I switch between speakers and headphone once a day max, so it's not) they can fix it within 2,5 weeks for free (within 2 years European warranty). I think I just buy a new external sound card which I was already planning to do.
If anyone succeeds in fixing this I would like to hear. Maybe I give it a try.