Fix bgfetch perf regression

Change-Id: I368cfdd92dab9123a9b3f9a24aefc3e58ee8e7ce
Fix cancel-shutdown race condition

Change-Id: I798606f9dd047d684aa6700d0e20713a71b227b2