Only close inventories if we are actually placing a block

Fixes http://www.spigotmc.org/threads/right-click-npc-open-inventory-spigot-1602.26992/