Add check for malloc errors when creating new clients.

This should prevent the server from crashing unexpectedly if its
host machine cannot allocate the program any more memory for clients.