Implement interrupt endpoint methods for host mode transfers.

Sponsored by:	DARPA, AFRL
Fix CID 1215129: move the call to lseek(2) before the call to malloc(3)
so that the error path (taken due to lseek(2) failing) isn't leaking
memory.
Fix CID 1215128: Free the allocated buf when image_set_size()
returns and error and we return from bsd_write().
Fix CID 1215125: fstat(2) returns -1 on error and sets errno. It does
not return the error (oops).
Fix CID 1215124: Handle errors properly.
Fix CID 1204394: Use strncpy(3) instead of strcpy(3). Note that it's
ok to not have the name and type strings terminated.
Fix CID 1204379 (vtoc8.c) & CID 1204380 (bsd.c): Cast ncyls to lba_t
before multiplying the 32-bit integrals to avoid any possibility of
truncation before widening. Not a likely scenario to begin with...