Modify the the threads callback error to store the error

when the error comes from the measurement but not from some bug in the code. This was proposed by teor in legacy/trac#28868 (moved):

Modify result_putter_error() to store an error result to the queue.