Further work attempting to pass handles on the commandline.
I needed to keep a handle to the handle, else the file descriptor gets closed.
Removed testing code.