Allen Weisselberg, President Trump’s longtime financial gatekeeper, was granted immunity by federal authorities and testified before a grand jury, the third confidant of Mr. Trump known to have provided information in an illegal hush-money investigation that has implicated the president.