Government survives confidence vote after 19 hours of debate