Properly find portal material when teleporting an entity

An EntityPortalEvent may be fired, even when the entity is not exactly inside the portal.
In this case, the block at the entity's location is probably air, thus cancelling the teleport.