Extend test for existing serialnumbers if other devices have the same serialnumber already
This change improves the check for existing serialnumbers (to show a hint in the frontend).
The old way, it just fetched the overall list of serialnumbers and excluded the current value. In most cases this worked, but it has problems if I edit a device and there is already another device with the very same serialnumber.
The backend got new parameters, so that I exclude certain ids from the distinct search, so we use this now. It has the benefit that I can exclude the current id, and may still get the serialnumber if it is used by another device. So I check there for a collision with the entry the user wants to save.
This change here also applies for the platforms serial numbers.
Closes #383 (closed)