[userprog] add stdin handling, exit on invalid fd