Update lights.py

The last two functions were never called if you tried to break out of the loop. I've added a try, except clause which will now catch the break and shut down gracefully