db: Use foreign key for userid in address table

Fix also a bug in function delUser which was found by the usage of
the foreign key.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
palma: Show correct icon for the device of connected users

Signed-off-by: Stefan Weil <sw@weilnetz.de>
palma: Handle users which are connected more than once in user list

This fixes a TODO item.

Signed-off-by: Stefan Weil <sw@weilnetz.de>