Fix generating opaque from realm options for DigestAuthenticate component

Generation of opaque value from realm for Digest authentication was broken. Added test case for testing DigestAuthenticate component's loginHeaders function.