US president's sowing of distrust in the integrity of the election is already setting up for a legal battle, highlighting the tension between the court and politics