Added thread protection to sequence saving and playing

Added saving debug logs to a file and thread safety