Man arrested after threatening to kill ex-wife and judge