Charge transfer in dissociating iodomethane and fluoromethane molecules ionized by intense femtosecond X-ray pulses