fix for max/min functions

fix bug introduced by
https://github.com/nuvolabase/orientdb/commit/dee9f205dea706ddf009e402632871a780326e61
as code never reaches second if clause. Now is expected to consider both
parameters as collection and collection in each item. 

iParameters has been assumed to be never null as this is expected to be guaranteed by the invoking code. Code is prepared to digest null items of null 'subitems' (items in a collection item).