Fix memory leak in DB tests

Change-Id: Ibc019addea7f5fe545fd04fb799d04947adbe7b7