escape_path performance.

escape_path is fast, about 1 microsecond per call on my computer,
but some have systems where it's called hundreds of thousands of times
(chromium) or even more (whatever nicolasdespres is doing).

For input which do not need escaping this is three times as fast in my
profiling. For chromium 48 out of 371000 paths needed escaping so
it was a 0.25 second improvement in profiling.

Note: The any() function made it slower or I would have used that.