fix calc_rtt

closes #192
Merge pull request #598 from LudwigOrtmann/ping_rtt

fix calc_rtt
Implement AUTO_FREE flag for thread_create
posix: add pthread wrapper
added pthread test case