Fixed a data race with RayTracer

When we run things in data-parallel since we cannot guarantee arrival
order. So we have to be careful on things that depend on arrival order.

This solves the race condition that we were seeing.

See #13.