SQLAlchemy can get confused if the parent database objects are not
linked when creating new records using the repository.
For example, when creating an L7 policy, even if you specify the
listener_id, sqlalchemy will drop the ID from the final SQL INSERT
parameter.
This patch corrects the L7 policy and rule create methods to have
the required parent objects linked.
Story: 2006305
Task: 36021
Change-Id: I4380605bdb346eee824b2ce05fa25175c4cc3034
(cherry picked from commit 36afa82d0c)