add worker failure robust api, a trivial test case and test case for kmp

almost same with mw_api, with two additional parameter timeout and failure probability for MW_RUN