[SPARK-2718] [yarn] Handle quotes and other characters in user args.

Due to the way Yarn runs things through bash, normal quoting doesn't
work as expected. This change applies the necessary voodoo to the user
args to avoid issues with bash and special characters.

The change also uncovered an issue with the event logger app name
sanitizing code; it wasn't cleaning up all "bad" characters, so
sometimes it would fail to create the log dirs. I just added some
more bad character replacements.
I'm trying to parse this in my head, looks like a single quote becomes this: `'\"'\"'`. Could you explain this? It looks like we're wrapping a single quote in a pair of double quotes in a pair of single quotes.