Fix a bug where the package stats query timeout may crash. am: cf76a16e66
am: e76b9dcb62

Change-Id: I341041c0edec8706cc449527b1dd130384a4ab01