agnosticbin: Change state elements state before removing it

Change-Id: I241067e5aac30acc66ff4f5ae8c94a9107b6d9f9