On the circuit complexity of random generation problems for regular and context-free languages