allow passing a function for maximumSelectionSize

as directed by @ivaynberg in https://github.com/ivaynberg/select2/issues/648#issuecomment-12080812