English author and humorist whose Hitchhiker’s Guide to the Galaxy brought razor-sharp wit to science fiction.