Change pipeline_manager to instance attribute in hooks

We should not assume the type of object which pecan.make_app() return
because it varies based on different configuration settings during the
test.

In order to achieve this, we have to change the PipelineHook's class
attribute pipeline_manager to be instance attribute, otherwise,
different api server created for different DB back-end would end up
sharing the same pipeline_manager which would break test tests.

(Failing unit tests in gate, manually booting it out. Please *DONT*
run recheck no bug on unit test failures).

Change-Id: Ic4370b1b8bec5723a0d719c74bdcdad8a6552912
Closes-Bug: #1327032
Fixed unit test TestRealNotification

The way how the unit test
test_notification.TestRealNotification.test_notification_service was
constructed would sometimes let the main test case check the result even
before all the expected notification listeners finish processing. This
would cause failure in gate test.

We should make sure the test case check the result after all the
expected listeners finish processing the notification.

Change-Id: I5333d83365fc39264b1002030494556f90319312
Closes-Bug: #1327344
Merge "Fixed unit test TestRealNotification"
Merge "Change pipeline_manager to instance attribute in hooks"