[SPARK-2531] [SQL] Make BroadcastNestedLoopJoin take into account a BuildSide

JIRA ticket: https://issues.apache.org/jira/browse/SPARK-2531
Move out `Array.fill(right.output.size)(null)` to avoid object creation in every iteration.