Structural change, catching up and falling behind in the BRICS: a comparative analysis based on trade patterns and Thirlwall's law