Bounds on the number of bound states for potentials with critical decay at infinity