Implement waiting for death/fed in the main
This is only half the protocol implementation. It is complicated
because I cannot use signal handlers to clean after the philosopers.
The basic idea is that an end condition posts the death semaphore.
It is that used and posted imediately by the threads waiting for it.
In main thread waiting for death this ends the thread_fed.
The thread then waits for all philosophers to switch to not alive
so that it can post the term semaphore without any printing.
The term semaphore has to be posted because philosophers may be waiting
for it and would be stuck there forever.
To be implemented in next commit:
In philosopher thread the death semahore couses the alive var to switch
to 0. Additionally the philosopher posts the end semaphore
which (when all philos do so) signals to the main process it can post
the term semaphore.