Fix dialyzer warnings about violation of type opaqueness.

Change-Id: Ia96e9e59135e4b1fc22658fe1076389334fe195a
Reviewed-on: http://review.couchbase.org/35712
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>