Only open space when an RFID card is seen.

Signed-off-by: Paul Brook <paul@nowt.org>
Improve thread handling.

Signed-off-by: Paul Brook <paul@nowt.org>