I had the sound issue as well. When I close my laptop lid with an headset plugged in (and especially if I unplug it before opening the lid), Mavericks totally looses track of audio and behave erratically.
I have been able to make sound work again by killing the coreaudiod process. it is very brutal, but it works.