network/link: ENODATA from reading IFLA_MASTER when an interface has no master
When an interface leaved from the master interface, then reading
IFLA_MASTER attribute causes ENODATA. When the interface was previously
enslaved to another interface, we need to remove reference to the
interface from the previous master interface.
This is especially important when
```
ip link set dev eth0 nomaster
```
is called.
Fixes a bug introduced by
0d411b7f8f5407e9ce84dcb4ede0b029ade7fede (v249).
Fixes #37629.
(cherry picked from commit
f44b20b7b6c6b0a089a3ec2392ac85e4772e0357)
(cherry picked from commit
2ad46c06069ad4241c94124dd5a3a73da7828048)