Influence of calcium substitution on the formation and thermal stability of the YBa2Cu4O8 superconductor