Trump reaches deals with 5 law firms, allowing them to avoid prospect of punishing executive orders