Fixed compilation errors from lastcommit.
Added a type new_semaphore_t.
Merge branch 'sam_alt' of github.com:rethinkdb/rethinkdb into sam_alt