FreeBSD requires sys/rwlock.h to get the rw_assert and RA_WLOCKED definitions.
conn_state_names is used in an exported inline function so
should be exported as well.
Fix some compiler warnings:  atomic_t on FreeBSD is unsigned
Fix a compiler error:  Function should return a value here.