Bug 884182 - Prevent incorrect state transition. r=doublec, a=leo+