[BUGFIX] JavaScript generation in RTE element browser

The JavaScript in the RTE element browser is now initialized at the
end of the initialization process to make sure that all required
class variables (like $this->act) are initialized.

Resolves: #56860
Releases: 6.2
Change-Id: I39d3223921c5b17cffb31d98d62f02fa46663d27
Reviewed-on: https://review.typo3.org/28338
Reviewed-by: Tymoteusz Motylewski
Tested-by: Tymoteusz Motylewski
Reviewed-by: Markus Klein
Tested-by: Markus Klein