create build env for both dokku and new style buildpacks

This functionally works in that we get both a useful `/app/.env` and per-variable file in `/tmp/env`

ref: #787
Nice catch. To be fair, I kind of blindly copy and pasted that from @vincentfretin comment in #787.