Added some error handling when gen_tcp:accept() doesn't work.