linux/ToUserDevice: bail out if encap fails

If WritablePacket::push fails here, we end up with a dangling pointer.
Instead, adjust wp and just bail out if we were unable to push.

Signed-off-by: Derrick Pallas <pallas@meraki.com>
linux/ToUserDevice: the pointers are volatile, not the objects

Signed-off-by: Derrick Pallas <pallas@meraki.com>
linux/ToUserDevice: replace pointer with array index

It is a bad idea to put a pointer to an element into file_priv since the
router might be destroyed while the chrdev is open.  This change stores the
minor number instead and then looks up the ToUserDevice in the elem_map.  If
the element goes away, it should already clear its own entry in the map.

Signed-off-by: Derrick Pallas <pallas@meraki.com>
linux/ToUserDevice: bail if kmalloc fails for file_priv

Signed-off-by: Derrick Pallas <pallas@meraki.com>
Merge pull request #122 from pallas/touserdevice-nits

ToUserDevice nits