git: Always return the before/after revisions, even in check mode.

This is a follow-up to https://github.com/ansible/ansible/pull/4367, which has become a bit more ~~complex~~ comprehensive. Two possibly significant changes:
- `git ls-remote` is now being done in check mode as well, to get the correct `after` revision at the expense of noticeably slower operation.
- The module now deals with full length SHA-1 hash exclusively.