test: extract curl errors from stderr output
server: fix max connections socket handling