Follow-up of request #36836. There is no DB transaction when deleting a project dashboard, so it's possible that the dashboard is deleted, but the recent visits to it are left (which might have caused the previous fatal error). We should group them together in a transaction so that everything is cleanly deleted, or nothing.