falling down if doc had an element 'error'

cleaned by makig sure doc has element.error, and just two elements, and then
when finished sticking new doc in, purge error and such from doc

affected both couch.get.state and couch.set.state