Transfer Attacks and Defenses for Large Language Models on Coding Tasks