fix timing bug with predetermined_variables command and model-local variables

See #1602

(manually cherry-picked from d686275da142e2d1e1afcdb32785c25f25b5a5a7)
4 jobs for 4.5 in 56 minutes and 8 seconds (queued for 4 seconds)
Status Job ID Name Coverage
  Build
passed #1296
build_binaries

00:08:13

passed #1297
build_doc

00:02:51

 
  Test
passed #1298
testsuite_matlab

00:47:55

manual #1299
allowed to fail manual
testsuite_octave_manual