Added stricter checks for attached-ness in coroutine resume functions.