Fixes socket leak in HTTP server.

Fixes #1643.
Merge pull request #1647 from mc-server/SocketThreadsFix

Fixes socket leak in HTTP server.
Replaced most auto_ptr with unique_ptr.