Melandri edges out Guintoli for the win in Race 2