iPhone always thinks headset is plugged in
In most current audio ports on Apple products, the audio jack contains a small switch which senses when a jack has been inserted.  It is likely your phone's switch has some debris that has disconnected the circuit, something that I've observed on multiple occasions with multiple users devices.  I myself am constantly getting pocket lint in the various ports of my phone.  Someday it will probably result in the same issue you're having.

You need to somehow get the sensor working again, or work around it.  Try using canned air (from your local electronics or office supply store) to blow out the port.

Since the audio jack is soldered to the phone's motherboard, if this is a deal-breaker for you, you might have to replace it.