on() should not execute block when no hosts given

When an empty array is provided to the on() method the attached
block should not be executed. Prior to this commit it would be
executed with the value of host set to nil.
This situation arises in capistrano when a role has no servers,
in which case the value of roles(:role) is []

Note that I changed resolve_hosts! to resolve_hosts and initialized
@hosts at initialization. This seemed cleaner.