Remove homegrown mutex implementation
All multithreading synchronization objects have been implemented on top of mutex and condition variable primitives from the operating system.
This merge request also includes
- better tests (tests no longer use sleep for synchronization purposes, tests should no longer fail due to timing issues)
- timeouts for condition variables and mutex locking operations (closes #90 (closed))
- read-write locks are always provided (we use our own implementation if no OS rwlocks are available)
- removal of spinlocks
- finalizers for builtin objects are now run only when the object is unreachable from other finalizers. This prevents these finalizers from being run before another user-defined finalizer makes the object reachable again.
Since these changes are rather large, I think it makes sense to make another bugfix release before merging them. @jackdaniel: any progress on the review for !230 (merged) and !222 (closed)?