Fix a couple of places in res_agi where the agi_commands lock would not be