JAVA-891: Added an additional check for NULL character to BasicBSONEncoder.