Safe exit when malloc returns NULL.
Exit when dlerror().
Added a forgoten \n. Also, exit when we can't open x display.