What is the difference between Go's sync and locks for ensuring the consistency and integrity of shared data among multiple goroutines in Go programs?