Fix deploy:write_revision timing and directory

It must be executed before assets:precompile because REVISION is used in
Rails initializer.