Application env honors `rails_env`

If capistrano-rails gem is used, we honor the `rails_env` option required by
that plugin.

Fallback to `stage` option. This solution is backwards compatible.

This pull request is equivalent to
[this](https://github.com/capistrano-plugins/capistrano-postgresql/pull/9)
PR for capistrano-postgres.