Fix broken use with --oneshot

Change-Id: Ia22ce85d84c7a5e2ea56824c0c011325d11d0d84
diff --git a/snapshot b/snapshot
index 30dffdc..551d687 100755
--- a/snapshot
+++ b/snapshot
@@ -165,6 +165,7 @@
     self.scrapframes = SCRAP_FRAMES
     self.sysfs = sysfs
     self.loop = None
+    self.thread = None
 
     if not oneshot:
       self.pipe_r, self.pipe_w = os.pipe()
@@ -244,7 +245,8 @@
 
   def connect_loop(self, loop):
     self.loop = loop
-    self.thread.start()
+    if self.thread:
+      self.thread.start()
 
 
 def main(arguments):