Collective dynamics of coupled oscillators with random pinning