This also changes the code to keep the connection open and adds automatic mainloop iteration to ensure the driver processes the request. This is important so we will not deadlock when we send multiple requests.
In case a LIBFPRINT_TEST_WRAPPER is defined, execute again the script using the same python processor but using the passed wrapper command.