added missing gr::thread::scoped_lock in work function