Merge "st-hal: fix pending ec ref count check against 0"