Fix crashes in QtHelp when too many connections are made

Backported from change 6481e28ba0d696cf41a2a5bc32b01db85f95b333 in qtbase

Task-number: QTBUG-36480
Change-Id: I3625d57a2f7b7b2f763a4cb92f19025b0401c593
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>