Make sure firstHandler is called only once

dataHandler was set to realHandler, but its previous value of firstHandler was already set as socket data handler so the change had no effect.
Also making sure that upgradeHead is released no matter it's length or value.