adv. assembly workbench: Match vanilla getStackInSlot behavior

The vanilla implementation checks for out of bound access and returns null in that case.
This fixes the following incompatibility: http://pastie.org/private/mn2yefhc5yddahbkxgcqw
Add better Pipe selection checking, open the gate GUI only if it has been clicked
Merge branch 'master' of https://github.com/BuildCraft/BuildCraft