The Baade-Wesselink method applied to RR lyrae variables in the globular clusters M5 and M92