In a rally timed to coincide with an annual dinner of the White House press corps in Washington, which he declined to attend, Mr. Trump laced into what he referred to as “the failing New York Times,” as well as CNN and MSNBC, which he accused of incompetence and dishonesty.