Distributed Inverse Dynamics Control for Quadruped Robots using Geometric Optimization