Speed up license checks
Speed up license checks

Previously the function _project_is_apache would get called twice for
every line being checked. And this function would read the file
'LICENSE' every time.

Since we don't expect 'LICENSE' to change during the run of hacking,
cache the result.

Using cProfile, _project_is_apache took:
Before: 1.030
After: 0.008

Change-Id: I762ad0f910f59c7844d283b7965b28628d6273b6

hyakuhei/cleantox,zancas/hacking,openstack-dev/hacking,zancas/hacking,openstack-dev/hacking,hyakuhei/cleantox