Electroweak baryogenesis and gravitational waves from a real scalar singlet