tools/pre-commit: Don't use stashes

Using stashes in pre-commit hook had the following demerits:
- when stash was not needed, it was not created, so some other stash
  created by user was poped on exit -- this was a source of great
  confusion;
- files with unstaged changes were touched, which caused unwanted
  side effects with some tools like editors or build systems.

This commit changes the way we get the clean source by checking out
index tree to temporary dir without modifying working tree. This
might be a bit slower for large repositories, but in my tests for
this repo it is within 5%.

Change-Id: Ic32fc2f52958b63131fcbe363ea47fca13099ea3