Liverpool survive scare to reach Champions League final