In my case, the last suggestion in comment 11 may work. I used to get shutdown time-outs of 90 seconds while the system was waiting for TeamViewer (3rd party) to shut down. I no longer get that error (possibly due to updates), but it is possible that TeamViewer is what is causing the delay in releasing root. I another forum, someone suggested allowing the first device-mapper error to post, then to remain silent unless there is a total failure in unmounting. Or if there were a way to add a 2 second delay to allow more time to complete the release of root, that may help.