Thread safety

A couple of commits to improve the thread-safety of Grabby. It might be easier to review each one on it's own.