Various corrections to get interpreted executables working again.

Dan Bradley reported an infinite loop for interpreted executables a few weeks ago. I wasn't able to reproduce it then but Haiyan recently found a way to reproduce it.

This PR is the result of making numerous corrections until I finally found the cause. f8881d6a3424a8875275f43bcd6ab07b6d6a22ed fixed the main issue where full_pread would infinitely loop on an error (caused by e06ceac2c06a4010cfdfb748152ddf577a76f92c).