What happens if an aircraft declares an emergency while there is another aircraft ahead cleared to land?
No, the airport wouldn't be closed, and the #1 aircraft doesn't need to go around nor be sent around.

The risk of him shutting down the runway is very slight, and is probably of the same magnitude of risk that sending him around to hold until #2 has landed &amp; the runway has been checked and reopened, would put him into a low-fuel emergency state. 

If they are both about the same distance (actually, time) away, then the emergency aircraft has priority (assuming that he doesn't decide to hold in order to troubleshoot, burn down fuel, prepare for the landing, etc), but essentially closing the airport from the time that the emergency has been declared until the emergency aircraft lands, isn't something I've ever seen or heard of.

The runway is often closed following an emergency landing until it can be checked by an airport vehicle, to ensure that it is clear of debris, spilled fuel/oil/hydraulic fluid/etc. And if the emergency aircraft can't clear the runway under its own power, it takes time to get it towed off, possibly pinning the landing gear (to prevent unintended retraction) first. Plus there may be an evacuation after the landing. So closing the runway for some time after the emergency aircraft lands, is entirely possible. 

But if the airport has planes in the pattern &amp; the emergency aircraft is 50 miles out, it'd be better to let those who want/need to land, do so, rather than risk them running low on fuel airborne while awaiting the runway's reopening.  Same basic logic applies in the #1 / #2 scenario posed above.

If aircraft regularly had their gear collapse &amp; shut down runways unexpectedly, that would be a different story. But that's exceedingly rare, so that isn't the contingency that all planning is based on.