Libcwd compile fixes

include linden_common.h first (is already included through the used
headers).
Bug fix: Wake up curl thread at exit of viewer.