I don't know if this is very useful information, but after some testing I think this problem might be in the OS. Setting the background connection seems work unreliably also if I do it from the settings menu. Sometimes I have to disable and enable the internet connection before background settings actually change. Maybe this could be used to make background settings change as desired. I don't know if this would be a very nice solution, though. However, this seems to happen with the settings menu, so it might be quite hard to find any other way... BTW, it seems to work just the same way when I change background connection setting in terminal by gconftool-2.