DRILL-3668: Incorrect results FIRST_VALUE function
added DefaultFrameTemplate.resetInternal() and generate code to set first value of internal batch to NULL at the end of each partition
added unit test to make sure bug has been fixed
this closes #146