Distributed Averaging in Population Protocols