Add dynamic link for clSetEventCallback, and add code to set stdout and stderr to line buffering in debug build