Analysis of nonlocal effects in turbulence closures with application to wall-bounded flows