Check that types exist before making factories.

It's possible that types used in factories depend on other types generated
by annotation processors (e.g. other factories!) - we need to make sure we're
not generating garbage code by writing out the factory when we can't resolve
the dependent types.

This is based on how Dagger checks that the types it needs exists.

Change-Id: I0a1234960a4e08c0a7c22220811132102b17c125
Reviewed-on: http://gerrit.dmdirc.com/3049
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>