[LAV-31] Make thread writing timeseries return null if there was error, so that main thread can terminate