First, don't quit your fp internship.
If you like treating adults more, and/or like critical care/ICU stuff more, and don't care to treat peds and ob/gyn patients, or you want to do a fellowship, I think switching is a good idea.
I actually think the best way to do this would be call up the career placement people @your med school first (especially if it's not @same place you are doing fp). Tell them what you want to do and see whether there is any chance that a spot might open up there, or at an affiliated hospital. If you feel safe doing so at your current program, you could talk to your program director about wanting to switch to IM, and see whether the IM program @your current place also might have a spot open (either prelim year or categorical). Unfortunately I think you missed out on the Match for this year, so the best option to find a spot is networking. You could also look on sites like the NRMP site or Openspots (not sure how reliable those sites are right now and how much they cost, but IM is one of the specialties more likely to have spots). Also you could just cold call places that you are interested in and see if they think they might have a spot somehow.
One thing need to decide ASAP is how much can you trust your family med program? Especially the PD. If the person is reasonable, he/she might help you to transfer within your own institution. If they want to not be helpful, or even get angry, that makes your job harder.
I think you'll probably end up with 1-3 months credit from your intern year. It isn't much, but your experience will help you in the sense that your 2nd internship will be easier than your current one.
If you can't get a spot in IM before July, you have to decide quick whether you would quit your internship to do research or something for a year. It's nonideal and has some risk, but if you go through year 2 of fp then you'll be at the point where it would almost be better to just finish the whole thing...and you'll be using up your Medicare funding.