generator: Fix handle being passed when type is a struct

A static getter method would always generate a Handle parameter even
though some types do not have a Handle, for example structs.

Closes issue #99.

Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>