Collaborative Distributed Beamforming for Spectrum-Sharing Systems