Perform internal database operations in FIFO queue

This breaks our embargo with Foundation, but our application had been
suffering as a result.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>