Fix matlab run dead lock.

When MatlabRun() is killed during "cd bin", some lock will be
mis-occupied and new() will dead lock.