Added mutex around clGetPlatformIds

This fixes the unit tests so that we don't have to run with RUST_THREADS=1. It is now set to 4, because if it is unset travis-ci returns an OOM error when allocating the command queues.