Add mutex to linenoise calls in std::rl

#4758

Is it sufficient to reuse the preexisting lock function? It *seems* to be already scoping the global lock.