Rethinking Deep Thinking: Stable Learning of Algorithms using Lipschitz Constraints