Fix discardconst warn

gcc warns about 'discarding const' when 'execute_command' is called here.  so temporaries are creating to remove the possibly confusing warning.