fix a bug in ta_waitall() return value
added a few tests, mainly to test waitall() return value and destroy functions