Bug 974291 - Correctly handle deleted items in getItemFlags. r=bnicholson