ECO: Energy-Constrained Optimization with Reinforcement Learning for Humanoid Walking