fdo#76078: LO Crashes while saving the docx file containing only opening brace

- System handles an equation having opening brace and closing brace.
- Whereas it fails to handle equations having only opening brace and no closing
  brace, due to which LO crashes with assertion while exporting.
- Fixed this issue and added unit test case for the same.
- Also fixed the same for closing brace alone.

Change-Id: I34a8a635b42bfdfac265fb70b977c0001cd2b4ff
Reviewed-on: https://gerrit.libreoffice.org/8561
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>