Behavior of magnetic field fluctuations during dynamo activity and its effect on energy confinement in a reversed-field pinch