'Avengers' earns $18.7 million in midnight showings