Alphabet gains 4% postmarket as Q2 near-miss dodges investors’ fears