SERVER-9818 allocate socket file descriptors before opening datafiles

Conflicts:
	src/mongo/db/curop_test.cpp
	src/mongo/util/net/listen.h
moved system.users upgrade into real upgrade framework #978

Also changed it to close each database in turn after upgrading, to avoid clogging the system with
opened files before listening on sockets
use an iterator to iterate over dbnames rather than building a whole vector in memory #978
fixes #978