Added rudimentary signal handling, so it properly closes the sound device when SIGINT or SIGTERM is sent.