Indeed. I like using a VERIFY macro:
#ifdef NDEBUG
# define VERIFY(x) ((x), 1)
#else
# define VERIFY(x) assert((x))
#endif
Then you can write VERIFY(pthread_mutex_unlock(&lock) == 0);
You don't need, however, to consider the possibility of your program continuing to run after pthread_mutex_unlock fails.