Correlation between in situ structural and optical characterization of the semiconductor-to-metal phase transition of VO2 thin films on sapphire