runsql: Improve detection of production environment