Fix locking for variables used for ISR sem give deferment