Coverity nits

Should fix CID 1168020, 1167490, 1167489, 1167488, 1126082.
Merge pull request #1269 from zeha/coverity

Coverity nits in webserver code