US president to 'immediately' sign bill to avoid shutdown