[brace-fold addon] Fix infinite loop when finding opening brace