Run-and-tumble chemotaxis using reinforcement learning