Randomized Positional Encodings Boost Length Generalization of Transformers