The time until the final zero crossing of random sums with application to nonparametric bandit theory