Update piracast.py

change to core running in background and kill core before exit