Optimize sending optical packet out non-optical port

Up to now when an non-optical port was about to send a packet it was doing
very expensive check to see if an incoming port was an optical one. Now
we're checking packet's headers to see whether it comes from an optical port
or not.