Added argument list to error_handler().
Added error handling for pthread_create() return value.