test: back-port EMFILE test from master branch

Back-port the test from commit 27795cf from the master branch ("unix:
fix accept() EMFILE error handling").
Merge remote-tracking branch 'origin/v0.10'

Conflicts:
	build.mk
	test/test-emfile.c
	test/test-list.h