Fixed an issue when the renderThread was faster than the thread creating
and adding a surface. NPE was thrown.