tests/malloc: fix of dereferencing a NULL pointer
tests/malloc: fix of dereferencing a NULL pointer

If the memory is exhausted during the allocation of the new `head` structure, subsequent accesses to `head` will result in dereferencing of a NULL pointer.
authmillenon/RIOT,lazytech-org/RIOT,aeneby/RIOT,miri64/RIOT,OlegHahm/RIOT,smlng/RIOT,yogo1212/RIOT,kaspar030/RIOT,jasonatran/RIOT,smlng/RIOT,miri64/RIOT,mfrey/RIOT,mfrey/RIOT,ant9000/RIOT,authmillenon/RIOT,aeneby/RIOT,smlng/RIOT,OTAkeys/RIOT,RIOT-OS/RIOT,toonst/RIOT,kYc0o/RIOT,RIOT-OS/RIOT,OTAkeys/RIOT,mtausig/RIOT,ant9000/RIOT,authmillenon/RIOT,miri64/RIOT,basilfx/RIOT,smlng/RIOT,cladmi/RIOT,yogo1212/RIOT,rfuentess/RIOT,cladmi/RIOT,x3ro/RIOT,authmillenon/RIOT,kYc0o/RIOT,kaspar030/RIOT,toonst/RIOT,yogo1212/RIOT,lazytech-org/RIOT,toonst/RIOT,basilfx/RIOT,rfuentess/RIOT,mtausig/RIOT,rfuentess/RIOT,basilfx/RIOT,yogo1212/RIOT,mtausig/RIOT,mtausig/RIOT,kYc0o/RIOT,aeneby/RIOT,authmillenon/RIOT,OlegHahm/RIOT,OTAkeys/RIOT,jasonatran/RIOT,RIOT-OS/RIOT,x3ro/RIOT,lazytech-org/RIOT,yogo1212/RIOT,RIOT-OS/RIOT,kYc0o/RIOT,basilfx/RIOT,cladmi/RIOT,mfrey/RIOT,OlegHahm/RIOT,OTAkeys/RIOT,jasonatran/RIOT,OlegHahm/RIOT,ant9000/RIOT,kYc0o/RIOT,mfrey/RIOT,aeneby/RIOT,smlng/RIOT,yogo1212/RIOT,cladmi/RIOT,cladmi/RIOT,mtausig/RIOT,ant9000/RIOT,josephnoir/RIOT,jasonatran/RIOT,mfrey/RIOT,OlegHahm/RIOT,josephnoir/RIOT,kaspar030/RIOT,toonst/RIOT,RIOT-OS/RIOT,kaspar030/RIOT,jasonatran/RIOT,ant9000/RIOT,josephnoir/RIOT,aeneby/RIOT,kaspar030/RIOT,x3ro/RIOT,toonst/RIOT,josephnoir/RIOT,miri64/RIOT,josephnoir/RIOT,rfuentess/RIOT,x3ro/RIOT,basilfx/RIOT,OTAkeys/RIOT,miri64/RIOT,lazytech-org/RIOT,x3ro/RIOT,authmillenon/RIOT,rfuentess/RIOT,lazytech-org/RIOT