Relation between static short-range order and dynamic heterogeneities in a nanoconfined liquid crystal.