r_pi build trial - fix posix thread issue and several warnings