Auto 219 locks

Add locking to maybe_execute_scaling_policy