Fix leak of kern.osrelease string, and correctly return nil in the case where fetching the osrelease fails