Update allow_signals() to return the old value, so that calling functions can choose to maintain existing state after a change.