Auto set the release stage

Set the release stage to dev if we are compiled with DEBUG on, or if the
debugger is attached - else default to production.
Yeah me too. I played around with various release build settings and I always ended up with a pretty well formed stacktrace so I couldn't see the need for the pdb file yet.