Stochastic approximation on non-compact measure spaces and application to measure-valued P\'olya processes