[javascript mode] Improve indentation of hanging else clauses

Closes #2429