resolves megaclear crashes.  horrah.  finally figured out that the problem was that constructModelmex was being cleared, therefore destroying the memory allocated with it, before the delete function was being called (at least on some platforms).  added mexLock and mexUnlock logic to protect against this.
apply fix to IKoptions mex
changed variable name as suggested by Hongkai
Merge pull request #268 from RussTedrake/memory_fix

Resolves at least one BIG memory bug.  hoorah