Flow regulator with safety valve