This patch implements the semicolon insertion logic into the extract refactoring.
The following rules are taken:
- extracting expression: add terminating ';' to the extracted function.
- extracting statements that don't require terminating ';' (e.g. switch): add terminating ';' to the callee.
- extracting statements with ';': move (if possible) the original ';' from the callee and add terminating ';'.
- otherwise, add ';' to both places.