Viscous potential flow analysis of magnetohydrodynamic capillary instability with heat and mass transfer