[PATCH 5.4 385/411] md: protect md_unregister_thread from reentrancy