A necessary and sufficient condition for the linear independence of the integer translates of a compactly supported distribution