ApiOptionsTest: Simplify hook restoration

Change-Id: I2afc35b45caf9ddfd34fb0bba0839987b7fb2ed4
Merge "ApiOptionsTest: Simplify hook restoration"