Fixed load_secrets to acquire/release lock in level 0 only