lib: Fix regression in thread.c

* Fix regression introduced with merging of

    'lib: Refactor read/write functionality'
1 file changed