Speed up some beakerd queries by making use of the index on the 'deleted' column

Bug: 1022888
Change-Id: Iadf6f6767bf119eca341d1fd7628923f2a766a61