Fix atom.sh when running from directory with space

Deal with ATOM_PATH having a space by proper quoting, and not passing
the directory name to dirname.

Fixes atom/atom#4336
I'd like to go with `xargs -0` (my sed skills are very limited), thanks for testing it.