[DF-4152] Posix code moved to separate file. Little bit refactor for Thread.h and cpp.