[Tools] Simplify the newline logic in generate_gclient-xwalk.py.
[Tools] Accept --cache-dir in generate_gclient-xwalk.py.

See r210024 in Chromium: the (still experimental) "cache_dir" option in a
.gclient file allows gclient to set up a local mirror for git repositories
(by passing --mirror to `git clone') and then use them to speed up clones by
passing --reference and --shared to `git clone'.

This means that once a repository such as blink-crosswalk is mirrored like
this, creating one or more clones takes a few seconds instead of an hour or
more (provided "cache_dir" is properly specified in the .gclient files).

This feature is not very useful in the general case, as developers do not
normally have multiple clones around or need to clone from scratch very
often, but it helps a great deal in automation, as one can cache the
repositories once and test full builds much faster.

Important note: "cache_dir" is not supported by the depot_tools version
checked out by our Chromium 29.0.1547.57, but most people have their own
copy of depot_tools somewhere else anyway.
Merge pull request #698 from rakuco/gclient-cache-dir

[Tools] Add --cache-dir support to generate_gclient-xwalk.py.