autosave: handle dead objects

(integrated from trunk branch change 3fee60f by Todd Whiteman <toddw@activestate.com>)