DictionaryBuilder: disallow null keys and/or values; add tests

Signed-off-by: Francis Galiegue <fgaliegue@gmail.com>