[PATCH v6 01/16] selftests/resctrl: Fix closing IMC fds on error and open-code R+W instead of loops