Introduce thread-local allowBlocking flag

Test: see instructions in http://ag/7911739
Fixes: 146675384

Change-Id: I478f2a8c4e4d8d563e5e78f6e103a62fe120191f
3 files changed