England collapsed after tea in Dhaka to hand Bangladesh the most famous Test victory in their history.