Coupled electronic and structural transition in the quasi two-dimensional conductors KxP4W8O32