Normalize whitespace in rails-post-deploy

The rails-post-deploy script unfortunately uses a mixtures of spaces
and 0x09 to represent indentation, so it's not even clear what local
convention to follow.  It appears from the mixture that the intention
is that the tabs should represent 4 spaces, so this commit replaces
them, strips trailing whitespace and changes some non-standard
indentation at the end of a bash heredoc.
Deal with ../logs existing, and log not being a symlink

The rails-post-deploy script would error if the log directory existed
(rather than being a symlink to another directory, for example) and
the ../logs directory also existed.  This commit changes this
behaviour to move the existing log directory out of the way in this
case.

In addition, this commit switches from removing the old symlink and
creating a new one (which creates a gap in time during which the log
directory doesn't exist) to using "ln -snf" to just overwrite any
existing symlink or file.  (Note that this is still not an atomic
operation, but it's bound to leave less time between removal and
creation.)