libnetwork/resolvconf: some cleaning up and optimisations
See individual commits for details

**- A picture of a cute animal (not mandatory but encouraged)**


libnetwork/resolvconf/utils.go
package resolvconf

import (
	"crypto/sha256"
	"encoding/hex"
	"io"
)

// hashData returns the sha256 sum of src.
func hashData(src io.Reader) (string, error) {
	h := sha256.New()
	if _, err := io.Copy(h, src); err != nil {
		return "", err
	}
	return "sha256:" + hex.EncodeToString(h.Sum(nil)), nil
}

package resolvconf

import (
	"crypto/sha256"
	"encoding/hex"
)

// hashData returns the sha256 sum of data.
func hashData(data []byte) []byte {
	f := sha256.Sum256(data)
	out := make([]byte, 2*sha256.Size)
	hex.Encode(out, f[:])
	return append([]byte("sha256:"), out...)
}

It can be done with even fewer allocs:
```suggestion
const hashPrefix = "sha256:"

func hashData(data []byte) []byte {
	out := make([]byte, len(hashPrefix)+hex.EncodedLen(sha256.Size))
	copy(out, hashPrefix)
	f := sha256.Sum256(data)
	hex.Encode(out[len(hashPrefix):], f[:])
	return out
}
```