io.ports: some cleanup before optimizations.
io.ports: use fixnum where possible, assert c-ptr since we use memcpy.
io.buffers: unsafe code is more unsafe.