Conformational dynamics of bacterial trigger factor in apo and ribosome-bound states