src: RegisterHandleCleanups reduce duplication
This commit suggest using a lambda for the RegisterHandlerCleanup calls in RegisterHandleCleanups.
The motivation is to reduce some duplication and to make it a little easier to read as all of the calls pass in the same arguments, apart from casting the uv handle.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines