[pyqgis-console][fix #8392] automatically removes the redundant char when autoclosing brackets option is enabled