Functional-renormalization-group approach to circuit quantum electrodynamics