Use pyuv synchronization primitives

By using pyuv synchronization primitives we avoid a deadlock when running the
tests on travis. Need to investigate if this is a bug with travis python,
because when running locally(python 2.7.6) I never got any deadlocks.
Update system on travis before_install script