Make 'rake themes:install' safer for developers

Previously, the themes:install rake task would remove the existing
theme with 'rm -rf' and re-clone the theme into place.  This is
unfortunate for a developer who has been making changes to a theme
and then runs the rails-post-deploy script, since it calls the
themes:install task which will wipe out those changes.  In
addition, when installing themes it would deliberately remove the
.git directory of the theme, so if you do want to work in that
theme you'd have to reinitialize the theme directory to be a git
repository again.

This commit changes the task so that now:

 - If a theme directory is present but it isn't a git
   repository, it's moved out of the way.

 - If there's no theme directory at the expected location after
   that step, the theme repository is cloned into place

 - The task ensures that the origin remote points to the theme's
   URL, and fetches from that remote.

 - If there are any uncommitted changes in the theme repository
   or the current commit appears not to have been pushed, the
   task exits with a helpful error.

 - The preferred branch or tag is checked out in the theme
   repository as before.

(The uninstall, install and post_install hooks are run as before.)

This shouldn't make a difference to deployed instances of Alaveteli
but will be helpful for developers who want to work on developing
a theme.

Fixes #1111.
Merge branch 'feature/less-destructive-themes-install' of ssh://git.mysociety.org/data/git/public/alaveteli into feature/less-destructive-themes-install
Merge branch 'feature/less-destructive-themes-install' into rails-3-develop
More detail on how to make a pull request.