open_settings_r() and open_settings_w() need to cope with a NULL session name.