A low-mass-ratio and deep contact binary as the progenitor of the merger V1309 Sco