fix repeat release of semaphore permit when onException