In a series of narrow and technical rulings, the justices have seemed to take pains to avoid a showdown with a president who has challenged the judiciary’s legitimacy.