Don't pass a null cond to pthread_cond_destroy

pthread_cond_destroy will happily crash if it gets a null pointer. We need
to make sure the pointer we pass has a value to prevent the crash

Signed-off-by: Mohammed Hassan <mohammed.hassan@jollamobile.com>
Merge pull request #56 from foolab/null

Don't pass a null cond to pthread_cond_destroy