Fix with calculation for inline event frame

fixes #4369
Fix symmetrical bracket creation not guaranteed in Icinga_DoctrineQuery

refs #4733
Merge branch 'next' of ssh://git.icinga.org/icinga-web into next