Perturbation analysis of stochastic hybrid systems and applications to resource contention games