_random: added ValueError to handled exceptions (fixes #8662)

I think this completely resolves the issue, and it does not break any tests. I'm not sure it is the best solution because I'm not overwhelmingly familiar with the codebase. I could have also fixed this by making the _new_args_filter() function in miscellaneous.py throw a TypeError - which _random already handles - instead of a ValueError.