BUG: incorrect CMake variable for system jpeg include

This was encountered when doing some weird cross-compilation.

FindJPEG defines the following:
  JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
  JPEG_LIBRARIES, the libraries needed to use JPEG.
  JPEG_FOUND, If false, do not try to use JPEG.

Change-Id: I565b9c8b1399a1e2973ec5b4813497b1df64add0
Merge topic 'release-JPEG_system_include'

579248d BUG: incorrect CMake variable for system jpeg include
BUG: Memory leak after failed RegisterFactory

If a RegisterFactory fails, the opened library was not closed. This
resulted in a memory leak.

This patch closes factories that fail to load.

Also, RegisterFactory now returns true if the factory loads and false
if it does not load.

Change-Id: If8cc37469b5d760d453b818d1c6a35058ab4d1ea
Merge topic 'ObjectFactoryMemoryLeak'

91d7549 BUG: Memory leak after failed RegisterFactory