DRILL-2326: Fix scalar replacement for the case when static method which does not return values is called
- Fix check for return function value to handle the case when created object is returned without assigning it to the local variable
closes #1687