[PATCH 5.10 135/172] md: protect md_unregister_thread from reentrancy