Add testcase for Redmine #6577

This verifies that functions are not evaluated if they are used
in a promise that is skipped via ifvarclass.

This is not a bug in master, and this test passes with 3.6.2 as well,
but there is a bug in 3.6.x due to code that explicitly tries to
skip function evaluations in disabled proimses (the redmine ticket).
Fixing the bug by removing that code, and including this test to
ensure that we don't regress wrt function evaluations.
(cherry picked from commit 7102e5027e2ce7cba37851d166c1eff5edf3152a)
Evaluate functions also for ifvarclass'ed promises

This takes in a small modification from
3054d112a4b537c63a248dc59b6aa66f53d9f6dc and reverts parts of
the logic introduced in f0f4743f4071c9f605da13bee9ea4f195b826ca3.

In master, we no longer skip function evaluations here at all -
the promise skipping should be done earlier.