Flake's Senate farewell speech cites threats to democracy