Fix bug in AutocorrectAlignment#heredoc_ranges

Fixes #1174 and fixes #1176.
Merge pull request #1178 from jonas054/fix_heredoc_ranges_crash

Fix bug in AutocorrectAlignment#heredoc_ranges