An almost sure conditional convergence result and an application to a generalized Polya urn