Bug 831822 - Fix various rooting hazards and unnecessary roots found by static analysis, r=terrence.