Small fixes

Small code fixes.
- Unfold loop.
- Initialize ivars which didn't initialized.


Tested with unittest & flare-tests.
please call destroy methods in thread_queue::~thread_queue()