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
(cherry picked from commit 3a8fdd9470d36e867b9f4ee0346efe3a7b03250c)