Second order perturbation theory for improved gluon and staggered quark actions