log_to_yaml: only export result if the optimal solution was found.

See roboptim/roboptim-core#56
capsule_display: add the possibility to choose the solver (ipopt, nlopt, etc.).