Fix some mutable variable warnings.
Merge pull request #3500 from glennw/warning-fix

Fix some mutable variable warnings.

Reviewed-by: pcwalton