test: Use new byte literals instead of macros
Run the curl cleanup function at process exit

This helps to cut down on the leaks when the process exits.