Spin and charge density waves in the quasi-one-dimensional KMn6Bi5