[PATCH 4.19 265/287] md: protect md_unregister_thread from reentrancy