Arrival Control in Quasi-Reversible Queueing Systems: Optimization and Reinforcement Learning