fdo#74512: Generate escaped sheet names after the grammer is set.

Otherwise the single quote characters wouldn't be properly doubled.

Change-Id: I864ca8912a35049905e52e002d92d648e1278015
(cherry picked from commit 83cdcdb9f0fe11309939f5dca4fb46e426559896)
Reviewed-on: https://gerrit.libreoffice.org/7947
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>