cleanup trajectory optimization examples (now everything uses the new interface)

to be included in drake v 0.9.7
What's the purpose of this loop? I don't see anything non-deterministic here - what can change between iterations that would make it fail one time and succeed the next?