db: Don't use db queries outside the session_scope

In list_users and list_projects we had:
with session_scope(self.session) as s:
    return s.query(TABLE)

Actually, the query will only be executed when all() is called or the
result is being iterated over, but then this causes a new transaction to
be started, which is not terminated by the session_scope.

In fact, we cannot even change the code to:
with session_scope(self.session) as s:
    return s.query(TABLE).all()

In the ListUsersActions, when trying to print the user data, this
results in the following exception:
sqlalchemy.orm.exc.DetachedInstanceError: Instance <User at 0x2f532d0> is not bound to a Session; attribute refresh operation cannot proceed

So keeping database objects after we left the session_scope is not a
good idea in general. Instead we copy the data from the database object
into simple python objects and pass these to the outside world.

Signed-off-by: Stefan Gast <stefan.gast@linutronix.de>