idevicedebug: Fix redeclaration and incrementation of environment_index
idevicedebug: Fix broken logic when creating app arguments