Use mutex instead of spinlock when go to kernel. Fix the BDB multithread issue.