Beautify code in MacOSGrabber.cpp, fix wrong index var.
Fix dangling iterator problem in GrabberContext.