[indent-fold addon] Fix indentation folding

Fix next line after block being incorrectly folded into the block
Fix detection of the end of a code block
[indent-fold addon] Fix coding style, use lastLine not lineCount

Issue #1859