Direct observation of kinetic traps associated with structural transformations leading to multiple pathways of S-layer assembly