Fix potential SIGSEGV when there's no dot char in the namespace

Also add a return value check after the mongo_insert operation when try to create the index.
Merge pull request #134 from RockLi/fix-potential-sigsegv

Fix potential SIGSEGV when there's no dot char in the namespace