Possible jack problem
Alternatively, though, it could be a bad jack that makes only marginal physical contact when a plug is removed. If so, you have little to worry about with a warranty exchange. Just make sure you've sync'ed your phone to Zune on your PC, and your contacts/calendar to an Exchange or Windows Live account. You can wipe your phone yourself under Settings/About/More/Reset. About the only elements that won't be retained for a new phone once you've set up those Live and Exchange accounts are contact groups, settings, and old SMS messages.
Nokia Lumia 900 OS 7.10.8112.7, Firmware 2175.1002.8112.12084
LG Quantum C900 - ATT; Interop unlocked, RootTools policy unlocked; OS 7.10.7720.68, Firmware 126.96.36.199