_git: fix __git_committish_range_{first,last} and __git_is_committish_range

- Ranges with 3 dots would always fail, because the non-greedy
  expansion  %..(.|)* in __git_committish_range_first would only
  remove '..' and never three dots. 'a...b' would end up in 'a.'.
  Use ${${1%..*}%.} instead.
- Use a similar approach for __git_committish_range_last.
- Wrap them in another expansion to replace empty results with 'HEAD'.
  Git man-page states omitted range ending are being replaced with
  HEAD. This rule has to be followed to make completions like
  'git log HEAD.. -- <tab>' work properly.
- Add an additional check to make sure none of the extracted first/last
  parts contain additional '..' in invalied ranges such as 'a..b..c'.
  This gets rid of the 'TODO:' and ideally saves a few unneded
  calls to git rev-parse.
_git: refactor and fix git diff completion

Before this, there were several cases where the completion
would offer the wrong things:

$ git diff branch1..branch1 -- <tab>
would try to complete "changed in workdir files", but needs to
complete "tree files in branch2".

$ git diff branch -- <tab>
same

$ git diff --cached -- file1 file2 <tab>
would try to complete "changed in workdir files" but needs to
complete "changed in index files".

...

After this change all possible combinations are taken into
account and completion should work properly.