Fix potential invalid index exception in ScintillaHelper.ActivateDocument()