Add let for local variables

In original code, such variables are declared as global variables
and cause byte-compile warnings.
Merge pull request #2 from syohex/fix-for-local-variables

Add let for local variables