Resolves memory failure in NonlinearProgramSnoptmex on win32 

and fixes unit tests on windows. 
(didn't really mean for these to be lumped together, but i don't see any harm)