Fix critical issues in Sonar

Sonar fixes. https://sonar.openrepose.org/drilldown/issues/1893?&rule=squid%3AS1166&rule_sev=CRITICAL&severity=CRITICAL