Rotations and densities of trans-Neptunian objects