Fix notification buffer race conditions

**Ready for final code review and merge**

Harness and unit test test are working.

This PR would close https://github.com/telefonicaid/fiware-orion/issues/13