fix snopt problem

Now NonlinearProgramSnoptmex can print to the right file, using master SNOPT. Also ik and iktraj in C++ works with SNOPT