Added:
    boost::shared_lock< boost::shared_mutex > lock(_chain_and_pool_access);
to the getNameRow, and made the other name related commands protected. Note that the HTTP server runs in a separate thread and hence the calls made to the const BlockChain need to lock the access to the database. Alternatively use another db connection. However, the line above should be sufficient.
Also enabled name_show for libcoind