Work around weird bug in clang

When compiling with clang with optimisation turned off, the produced binary would (on most occasions) crash at some point during al_host_init(). This started after updating to use streams for the scripts, moving that code into its own function seems to avoid the bug.