Stacking transition in bilayer graphene caused by thermally activated rotation