hooks: ignore non pyc files during autoinstall

Generating an image without image-minimizer.ks the .py an
.pyo files will remain in the ISO.
However, the current hook logic is check if the hook file is .py
and execute it calling with python binary or execute the script
directly. Based in that assumption, .pyc and .pyo will be called
as script and will make the autoinstall fail.
This patch, removes the duplicate code around this logic and
will ignore .py and .pyo files, executing only .pyc or any other
hook script.

Change-Id: I8c87a3db450ac4c4172c5540f7552c0e03d90066
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>