added locking around unmounting