Wiltshire Police apologises after officer took names of those buying copy of Charlie Hebdo magazine