Added device.c for NetBSD, actually a copy of the OpenBSD one.