Liberals survive confidence motion and avoid election