core: improve CPU usage of the TCP_MAIN process

	* iterate through and close connections at most once per second
(cherry picked from commit 3ac3b042c7b74cc6c84af0a987ac65cde17f8e6b)

Conflicts:

	tcp_main.c