forms: Fix corruption of company name on new ticket

New ticket by staff would cause the %{company.name} variable to be
incorrectly replaced as the user's name in email templates.
Partially revert 37b8d549d610c

That patch introduced a bug where the list of dynamic fields for a form is
always empty
Merge pull request #1002 from greezybacon/issue/company-name-new-ticket-email

forms: Fix corruption of company name on new ticket

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #1004 from greezybacon/issue/979

Partially revert 37b8d549d610c

Reviewed-By: Peter Rotich <peter@osticket.com>
pass variable by reference