Apply @rprichard patches to atom-shell source

Ref: atom/atom-shell#849