Tweak git completion for aliases/stashes

Use the new `read -z` flag to complete git aliases better. This approach
won't break if an alias contains a newline.

Also fix stash completion, which was broken on BSD sed.