Consolidate duplicate code in TorBlockHooks

Change-Id: Ia9ac17200314536d63b4cf71bec8aeaf8370db42