Analysis of Newton-Raphson consensus for multi-agent convex optimization under asynchronous and lossy communications