Fix sync() race

I eliminated the internal locking because feed_lock handles it, but
sync() needs to hold it as well so it doesn't occur during trim()
(another out-of-feed call) and try to close a None object.