Use safe temp file instead of using sed buffers

https://github.com/robbyrussell/oh-my-zsh/pull/3257#issuecomment-60358947