Collaborative Distributed Beamforming for Cooperative Spectrum-Sharing Systems