[BUGFIX] Incomplete backup in befuncTest

Backport of tests of issue #47839 did not take care of a backup
of globals in 4.7 and introduced a side effect to other tests.
Those backups are automatically done in higher core versions,
so the fix affects 4.7 only.

Change-Id: I5db0c82ad1e95ed1c271cfa25dbc2a38c5af5d25
Resolves: #49355
Related: #47839
Releases: 4.7
Reviewed-on: https://review.typo3.org/21606
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn